-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: HiVinayK
Message 1 in Discussion
Hi,
I have started implementaion for stored procedure in our application. I have to reuse
the existing method used in the DataAccess Layer.. Following the code snippet for the
execute method in Data Access Layer.
public int ExecuteSql(string SQLQuery)
{
int rowAffected = 0;
try {
string str = DBCon.State.ToString();
SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.CommandText = "TestInsert";
SqlCmd.Parameters.Add("@sqlString", SQLQuery.Trim());
SqlCmd.ExecuteNonQuery();
SqlCmd. SqlCmd.Parameters.Clear();
SqlCmd.CommandType = CommandType.Text;
SqlCmd.CommandText = ""; return rowAffected;
}
catch(Exception e)
{
throw e;
}
}
Stored procedure takes the sql string.. This stores procedure just executes the sql
string.. I am getting
"Procedure or function has too many arguments specified".
This Exception is not always generated...
Stored Procedure Syntax :
CREATE PROCEDURE TestInsert (@sqlString text)
AS
BEGIN
EXEC (@sqlString)
END
GO
Solution to this issue required urgently.. please help
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]