For calling a procudere from vb.net you have to use the Sqlcommand
paramenter in the following way:


Dim cmd As New SqlCommand
cmd.CommandText = "GetData "
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@sTablename", SqlDbType.VarChar,
255).value="Tablename"

Chaget the second first, second and third parameters of
cmd.Parameters.Add to reflect your parameter name, parameter type and
size also change the value of the parameter as per your requirement.


On Aug 11, 6:23 pm, Yogesh Dige <[email protected]> wrote:
> con = new SqlConnection(strConnectionString);
>             string strQry = "EXEC GetData " + strParameters;
>             command = new SqlCommand(strProcNm, con);
>             adapter = new SqlDataAdapter(command);
>
> i am using the above code for callin Stored Procecures i am passing
> the parameters as Table name, and a fields to the my general stored
> procedures. but it is giving the error that not finding the table name
> and it is asking the table name as " @sTablename".
>
> So please can any body help me for this.
> i want to use above method only.
>
> Thank you advance...

Reply via email to