C# + stored procedure

  • Thread starter Thread starter S.Ljungstedt
  • Start date Start date
S

S.Ljungstedt

Hallo!
How do I set parameters to a Stored procedures in the application?
 
S.Ljungstedt said:
Hallo!
How do I set parameters to a Stored procedures in the application?

string Username = "Me";
SqlCommand comm = new SqlCommand("exec sp_GetUser @Username",conn);
comm.Parameters.Add("@Username",SqlDbType.Char);
comm.Parameters["@Username"].Value = Username;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top