how to make it work?
i am working with a stored procedure in this i have to pass values from nearly 30 controls to stored procedure.
after declaring the connection string to cn i just did like this..
cmd = New SqlCommand()
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "sp_ConsultantMaint" 'SV', '-999',"
in the above line i want to pass some vcalues to stored procedure.becuse stored procedure is written with "if" condition.
after doing like this i just tried to pass the values like below..
Dim email As New SqlParameter("@Email", SqlDbType.VarChar, 100)
email.Direction = ParameterDirection.Input
email.Value = txtemail.Text
the parameters i passed"@Email is same as in the stored procedure.
like this i had written for nearly about 30 controls.
first i declared all parameters
second i gave add condition for all parameters
third i had given direction
and 4th i just gave the control names from where the parameters has to get the values.
i thought this code will work properly..but the program is executing and the values are not inserted into the database.
at the end i used cmd.execuitenonquery() statement..
please help me how to solve..
thanks in advance-ashok