anusdesai
asked on
Executing stored procedure with vb.net 2.0
Hi,
I am using a richtextbox to load a stored procedure in vb.net application.
Any points regarding how to execute the stored procedur like query analyser with vb.net will be helpful
Regards
I am using a richtextbox to load a stored procedure in vb.net application.
Any points regarding how to execute the stored procedur like query analyser with vb.net will be helpful
Regards
ASKER
Cheers ! will try and be right back
ASKER
Hi,
There is no specific method given in the article...
any example of function or procedure will be helpful
Cheers
There is no specific method given in the article...
any example of function or procedure will be helpful
Cheers
Do you have a stored procedure on your sql-server ?
Calling Stored Procedures with ADO.NET
http://www.developer.com/db/article.php/3438221
Below you can find an example to call the stored procedure "SelectCustomer" with 1 parameter
Calling Stored Procedures with ADO.NET
http://www.developer.com/db/article.php/3438221
Below you can find an example to call the stored procedure "SelectCustomer" with 1 parameter
Public Sub SelectCustomer()
Dim connection As SqlConnection = _
New SqlConnection(connectionString)
connection.Open()
Try
Dim command As SqlCommand = _
New SqlCommand("SelectCustomer", _ connection)
command.Parameters.Add("@CustomerID", "PAULK")
command.CommandType = CommandType.StoredProcedure
Dim adapter As SqlDataAdapter = New SqlDataAdapter(command)
Dim table As DataTable = New DataTable
adapter.Fill(table)
Catch ex As Exception
Console.WriteLine(ex.Message)
Throw
Finally
connection.Close()
End Try
End Sub
ASKER
Hi,
Cheers
But ,the requirement is i have a script in my sqlbox example
Go
declare @i smallint
set @i = 1
Update abc set @i = no =
case @i
when 1 then Countstmode
else @i - 1
End
GO
I need to read the script line by line and then execute .
Cheers
Cheers
But ,the requirement is i have a script in my sqlbox example
Go
declare @i smallint
set @i = 1
Update abc set @i = no =
case @i
when 1 then Countstmode
else @i - 1
End
GO
I need to read the script line by line and then execute .
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers ...will try abd be right back
Did it solve your problem ?
ASKER
Cheers mate..sorry for replying late was away for a while.
Cheers for being so concerned.
Cheers for being so concerned.
The Ins and Outs of Stored Procedures in VB.NET
http://www.vbdotnetheaven.com/UploadFile/dclark/StoredProceduresinVBdotNET04082005072716AM/StoredProceduresinVBdotNET.aspx