Prepare for your Next Interview
This is a discussion on how to run sql through vb.net within the SQL Server forums, part of the Databases category; how to run a sql server 2005 sp through a windows application programm designed with vb.net 2005...
|
|||
|
how to run a sql server 2005 sp through a windows application programm designed with vb.net 2005
|
| The Following User Says Thank You to gdtrigas For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: how to run sql through vb.net
What do you mena by to run a sql server 2005 sp through a windows application programm ?
are you trying to execute DML /DDL statments or something else ? |
|
|||
|
Re: how to run sql through vb.net
cmd = New SqlCommand("storedprocedure name", constr)
cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add("@variable name", SqlDbType.datatype, value).Value = selectedcontrol.SelectedItem.Value cmd.Parameters.Add("@variable name", SqlDbType.datatype, value).Value = ddCommodity.SelectedItem.Value constr.Open() varable name = cmd.ExecuteReader() |
| The Following User Says Thank You to mailamit.jais For This Useful Post: | ||
|
|||
|
Re: how to run sql through vb.net
Quote:
At the top of coding page write "Imports system.data.sqlclient", then there will be 1 line after that which will come automatically showing that webform after that write "Proteced sub as sqlconnection".............After that in the connection string every time write "Data Source=ASHISH\SQLEXPRESS;Initial Catalog=museum;Integrated Security=True"...................At the place of "ASHISH" write your computers name, at the place of "museum" write your database name from which u want to connect... Last edited by ashish rai : 3 Weeks Ago at 11:51 AM. |