
Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
|
20.05.2005, 16:14
|
|||
|---|---|---|---|
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 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|

start [/forum/topic.php?fid=17&mobile=1&tid=1353733]: |
0ms |
get settings: |
9ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
61ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
47ms |
get tp. blocked users: |
1ms |
| others: | 228ms |
| total: | 383ms |

| 0 / 0 |
