this is my function --
Public Function GetDataTableSP(ByVal val1 As String, ByVal val2 As String, ByVal val3 As String) As DataTable
Dim dtdatatable As New DataTable
Dim dtConnection As New OdbcConnection(ConfigurationManager.ConnectionStrings("DBConnection").ToString)
dtConnection.Open()
Dim dtcom As New OdbcCommand("SP_Login", dtConnection)
dtcom.CommandType = CommandType.StoredProcedure
dtcom.Parameters.AddWithValue("_action", val1)
dtcom.Parameters.AddWithValue("_uname", val2)
dtcom.Parameters.AddWithValue("_upassword", val3)
Dim da As New OdbcDataAdapter(dtcom)
da.Fill(dtdatatable)
da.Dispose()
dtConnection.Close()
Return dtdatatable
End Function
this is my code behing code -
Dim dtUsers1 As New DataTable
dtUsers1 = DBClass.GetDataTableSP("Select", txtUserName.Text.Trim(), txtPassword.Text.Trim())
this is my stored procedure in mysql -
CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_Login`(_action varchar(10),
_uname varchar(100),
_upassword varchar(30))
BEGIN
if _action = 'Select' then
/*select * from Regis where UName = _uname and pwd = _upassword;*/
select * from Regis where UName = _uname and pwd = _upassword;
end if;
END
when i am running my application , i am getting error like -
ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.6.10]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SP_Login' at line 1
I am not able to resolve this error.
Please help me.