|
|
|
Ado .net и работа с ХП
|
|||
|---|---|---|---|
|
#18+
Есть такая ХП: create procedure GetMessagesCount @Count int OUTPUT, @User varchar(100)=NULL AS IF isNull(@User,'')='' select @Count=COUNT(*) from messages; ELSE select @Count=COUNT(*) from messages where UserName=@User; и есть такой код: System.Data.SqlClient.SqlConnection Connection=new SqlConnection(); Connection.ConnectionString=ConnectionString; System.Data.SqlClient.SqlCommand Command=new SqlCommand(); Command.Connection=Connection; Command.CommandType=CommandType.StoredProcedure; Command.CommandText="GetMessagesCount"; SqlParameter Param=new SqlParameter("Count",SqlDbType.Int); Param.Direction=ParameterDirection.Output; Command.Parameters.Add(Param); Connection.Open(); int Count=(int)Command.Parameters["Count"].Value; Connection.Close(); В стороке int Count=(int)Command.Parameters["Count"].Value; - ошибка(те Value==null) В чем траблы? C ув. Tors ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.05.2005, 16:14 |
|
||
|
|

start [/forum/topic.php?fid=17&tid=1353733]: |
0ms |
get settings: |
12ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
48ms |
get topic data: |
7ms |
get forum data: |
2ms |
get page messages: |
34ms |
get tp. blocked users: |
1ms |
| others: | 249ms |
| total: | 368ms |

| 0 / 0 |
