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, 1417👍, 0💬
Popular Posts:
What is the purpose of Replication ? Replication is way of keeping data synchronized in multiple dat...
How To Enter Boolean Values in SQL Statements? - MySQL FAQs - Introduction to SQL Basics If you want...
What is synchronization and why is it important? With respect to multithreading, synchronization is ...
1. What is normalization. 2. Difference between procedure and functions. 3. Oracle 9i Vs 10g. 4. how...
What are the two kinds of comments in JSP and what's the difference between them? <%-- JSP Co...