Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How do you call and execute a Stored Procedure in.NET? Give an example.
How do you call and execute a Stored Procedure in.NET? Give an example.
✍: Guest
Answer1
ds1=new DataSet();
sqlCon1=new SqlConnection(connectionstring);
String strCom1=â€byroyaltyâ€;
sqlCom1=new SqlCommand(strCom1,sqlCon1);
sqlCom1.CommandType=CommandType.StoredProcedure;
sqlDa1=new SqlDataAdapter(sqlCom1);
SqlParameter myPar=new SqlParameter(â€@percentageâ€,SqlDbType.Int);
sqlCom1.Parameters.Add (myPar);
myPar.Value=40;
sqlDa1.Fill(ds1);
dg1.DataSource=ds1;
dg1.DataBind();
Answer2
Yes
Dim cn as new OleDbConnection ( “Provider=Microsoft.Jet.OLEDB.4.0;â€+ _
“Data Source=C:\Documents and Settings\User\My Documents\Visual Studio Projects\1209\db1.mdbâ€+ _
“User ID=Admin;â€+ _
“Password=;â€);
Dim cmd As New OleDbCommand(â€Productsâ€, cn)
cmd.CommandType = CommandType.StoredProcedure
Dim da As New OleDataAdapter(cmd)
Dim ds As New DataSet()
da.Fill(ds, “Productsâ€)
DataGrid1.DataSource = ds.Tables(â€Productsâ€)
2014-09-15, 1485👍, 0💬
Popular Posts:
Can static variables be declared in a header file? You can't declare a static variable without defin...
How To Control Horizontal Alignment? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells By...
What is Native Image Generator (Ngen.exe)? The Native Image Generator utility (Ngen.exe) allows you ...
How To Retrieve Input Values for Checkboxes Properly? - PHP Script Tips - Processing Web Forms If mu...
Wha is the output from System.out.println("Hell o"+null);?Hellonull