SqlConnection conn = null;
int rowCount;
string sConnectionStri ng = "packet size=4096;user id=sa;persist security
info=False;init ial catalog=LeonUse rs";
conn = new
SqlConnection(s ConnectionStrin g);
conn.Open() ;
userDb = new Db(sConnectionS tring);
SqlCommand cmdCount = new SqlCommand("Use rsGroupsSearch" , conn);
cmdCount.Comman dType = CommandType.Sto redProcedure;
cmdCount.Parame ters.Add (new SqlParameter ("@UserID",
userRecAccount. UserID));
cmdCount.Parame ters.Add("@RowC ount", SqlDbType.Int);
cmdCount.Parame ters["@RowCount"].Direction = ParameterDirect ion.Output;
cmdCount.Execut eNonQuery ();
rowCount = (int)cmdCount.P arameters["@RowCount"].Value; <---- an
error: " Specified cast is not valid."
Hrcko 1 1061
Hi,
use Convert.ToInt32
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Hrvoje Voda" <hr*********@lu atech.com> wrote in message
news:d4******** **@ss405.t-com.hr... SqlConnection conn = null;
int rowCount;
string sConnectionStri ng = "packet size=4096;user id=sa;persist security info=False;init ial catalog=LeonUse rs"; conn = new
SqlConnection(s ConnectionStrin g);
conn.Open() ;
userDb = new Db(sConnectionS tring);
SqlCommand cmdCount = new SqlCommand("Use rsGroupsSearch" , conn);
cmdCount.Comman dType = CommandType.Sto redProcedure;
cmdCount.Parame ters.Add (new SqlParameter ("@UserID", userRecAccount. UserID));
cmdCount.Parame ters.Add("@RowC ount", SqlDbType.Int);
cmdCount.Parame ters["@RowCount"].Direction = ParameterDirect ion.Output;
cmdCount.Execut eNonQuery ();
rowCount = (int)cmdCount.P arameters["@RowCount"].Value; <---- an error: " Specified cast is not valid." Hrcko
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Rob |
last post by:
Using VB.net and SQL server...
I have a stored procedure that is simply returning a row count....
I know how to execute a stored procedure and add the output parameter.
But how do I store that value to a variable ?
|
by: gacuna |
last post by:
i want to insert into a temporal table the result of a store procedure.
on sql server the sentence would look like this (already working)
INSERT INTO #SHIPINFO
exec TESTDTA.S59RSH05 @SCBILLTO, @INID, @ADRSTYPE
i tried to do the same on DB2, meaning
INSERT INTO SESSION.SHIPINFO
CALL TESTDTA.S59RSH05 v_SCBILLTO, v_INID, v_ADRSTYPE
|
by: c676228 |
last post by:
Hi everyone,
I am just wodering in asp program, if there is anybody writing store
procedure for inserting data into database since there are so many parameters
need to be passed into store procedure(assume there are many columns in the
table).
I need to insert data into two separate tables, the relation between these
two tables is 1 row of data in table1 could have multiple rows in table2
related to table1, but if the data insertion into...
|
by: seep |
last post by:
salam to everyone..
as a new bee in .net i m finding lot of difficulty. i want to get all records of a table from database via store procedure.but spending many days i dont know how can i do that.
some work that i do is:
Imports System
|
by: kya2 |
last post by:
I am not able to create following store procedure.
CREATE PROCEDURE DBSAMBA.InsertDeleteBatch(OUT norows INT )
RESULT SETS 1
LANGUAGE SQL
BEGIN part1
DECLARE TOTAL_LEFT INT DEFAULT 0;
SELECT COUNT(*)INTO TOTAL_LEFT FROM DBSAMBA.REPORTEDTRANSACTION_S;
WHILE (TOTAL_LEFT > 0)
DO
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |