Click here to Skip to main content
15,922,427 members
Home / Discussions / Database
   

Database

 
GeneralRe: Process Info Question Pin
andyharman27-Feb-03 9:37
professionalandyharman27-Feb-03 9:37 
GeneralRe: Process Info Question Pin
Bugoy27-Feb-03 12:27
Bugoy27-Feb-03 12:27 
Question2 sql statement using 2 command and 2 datareader? Pin
ylaine27-Feb-03 2:51
ylaine27-Feb-03 2:51 
AnswerRe: 2 sql statement using 2 command and 2 datareader? Pin
andyharman27-Feb-03 9:23
professionalandyharman27-Feb-03 9:23 
Generalsingle stored procedure Pin
ylaine28-Feb-03 5:44
ylaine28-Feb-03 5:44 
GeneralRe: single stored procedure Pin
andyharman28-Feb-03 7:22
professionalandyharman28-Feb-03 7:22 
GeneralRe: single stored procedure Pin
ylaine28-Feb-03 22:05
ylaine28-Feb-03 22:05 
GeneralRe: single stored procedure Pin
andyharman1-Mar-03 23:19
professionalandyharman1-Mar-03 23:19 
Laine

I would have expected something like the following (note that I don't normally work with VB.NET, and I haven't tested the following):

ocm = New SqlClient.SqlCommand("Login", SqlConnection1)
ocm.CommandType = CommandType.StoredProcedure
<br> <br>
'Input parameters @Username and @Password ...
pusername = ocm.Parameters.Add("@Username", SqlDbType.VarChar, 50)
pusername.Value = username
ppassword = ocm.Parameters.Add("@Password", SqlDbType.VarChar, 50)
ppassword.Value = password
<br> <br>
'Output parameter @CustomerID ...
pcustomerid = ocm.Parameters.Add("@customerid", SqlDbType.VarChar, 50)
pcustomerid.Direction = SQLClient.ParameterDirection.Output
<br> <br>
'Return value ...
preturnvalue = ocm.Parameters.Add("@ReturnValue", SqlDbType.Int)
preturnvalue.Direction = SQLClient.ParameterDirection.ReturnValue
<br> <br>
'Execute command (note that no data is returned)...
ocn.ExecuteNoQuery()
<br> <br>
'Check the outcome (I used ToString to avoid explicit casting) ...
if preturnvalue.Value.ToString() = "1" then
   customerid = pcustomerid.Value.ToString()
end if


I was unsure that all of your parameters should be varchar(50). I would have expected customerid to be an integer.

I hope this helps.
Andy Harman
GeneralRe: single stored procedure Pin
ylaine2-Mar-03 3:56
ylaine2-Mar-03 3:56 
GeneralDatabase ACCESS 97 to linked server SQL 2000 Pin
youssef26-Feb-03 23:23
youssef26-Feb-03 23:23 
GeneralRe: Database ACCESS 97 to linked server SQL 2000 Pin
David Salter27-Feb-03 23:20
David Salter27-Feb-03 23:20 
QuestionTextbox Control databinding, a bug? Pin
DionChen26-Feb-03 5:27
DionChen26-Feb-03 5:27 
GeneralDB access problem!! Pin
Andrea Ferraro26-Feb-03 3:13
Andrea Ferraro26-Feb-03 3:13 
GeneralRe: DB access problem!! Pin
DiWa26-Feb-03 6:21
DiWa26-Feb-03 6:21 
GeneralRe: DB access problem!! Pin
Andrea Ferraro28-Feb-03 3:06
Andrea Ferraro28-Feb-03 3:06 
GeneralADO help needed Pin
odeveloper26-Feb-03 1:09
odeveloper26-Feb-03 1:09 
GeneralRe: ADO help needed Pin
Jon Hulatt26-Feb-03 4:22
Jon Hulatt26-Feb-03 4:22 
Generalsingle access on store procedure Pin
Delz25-Feb-03 21:00
Delz25-Feb-03 21:00 
GeneralRe: single access on store procedure Pin
SimonS25-Feb-03 21:22
SimonS25-Feb-03 21:22 
GeneralRe: single access on store procedure Pin
Antares68626-Feb-03 0:15
Antares68626-Feb-03 0:15 
GeneralAccessing Visual Fox Pro 3.0 Data Pin
sybux200025-Feb-03 11:00
sybux200025-Feb-03 11:00 
GeneralRe: Accessing Visual Fox Pro 3.0 Data Pin
andyharman26-Feb-03 0:43
professionalandyharman26-Feb-03 0:43 
GeneralRe: Accessing Visual Fox Pro 3.0 Data Pin
sybux200026-Feb-03 5:06
sybux200026-Feb-03 5:06 
GeneralSelect statement Pin
User 988525-Feb-03 8:34
User 988525-Feb-03 8:34 
GeneralRe: Select statement Pin
Jeremy Oldham25-Feb-03 14:19
Jeremy Oldham25-Feb-03 14:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.