|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ODBC - ErrorI am getting the followign error when using ODBC from ADO.NET.....
System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'StoredProcedure' expects parameter '@Parameter', which was not supplied. I installed latest MDAC , still i am getting error... any help? On Thu, 23 Mar 2006 16:29:01 -0800, vsr <v**@discussions.microsoft.com> wrote:
¤ I am getting the followign error when using ODBC from ADO.NET..... ¤ System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server ¤ Driver][SQL Server]Procedure 'StoredProcedure' expects parameter ¤ '@Parameter', which was not supplied. ¤ ¤ I installed latest MDAC , still i am getting error... ¤ any help? You're going to have to post your code and the parameter definitions of your stored procedure in order for us to troubleshoot this problem. This error has nothing to do with MDAC. Paul ~~~~ Microsoft MVP (Visual Basic) Thanks for your reply , i was saying its problem with MDAC because i was
going through couple MSDN knowledge base issues and they suggested to install the MDAC latest srvice pack... anyway here is my code..... Dim db As Database = DatabaseFactory.CreateDatabase("Test") Dim sqlCommand As String = "dbo.tsp_Test" Dim dbCommandWrapper As DBCommandWrapper = db.GetStoredProcCommandWrapper(sqlCommand) With dbCommandWrapper .AddInParameter("@username", DbType.String, "Test") End With ' DataSet that will hold the returned results Dim productsDataSet As DataSet = Nothing productsDataSet = db.ExecuteDataSet(dbCommandWrapper) please suggest.... Show quote "Paul Clement" wrote: > On Thu, 23 Mar 2006 16:29:01 -0800, vsr <v**@discussions.microsoft.com> wrote: > > ¤ I am getting the followign error when using ODBC from ADO.NET..... > ¤ System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server > ¤ Driver][SQL Server]Procedure 'StoredProcedure' expects parameter > ¤ '@Parameter', which was not supplied. > ¤ > ¤ I installed latest MDAC , still i am getting error... > ¤ any help? > > You're going to have to post your code and the parameter definitions of your stored procedure in > order for us to troubleshoot this problem. > > This error has nothing to do with MDAC. > > > Paul > ~~~~ > Microsoft MVP (Visual Basic) > Well there is your problem.
The input parameter to the stored procedure is named @Parameter but you are adding a parameter called @username. Show quote "vsr" <v**@discussions.microsoft.com> wrote in message news:2A744FA0-3E1F-4BB9-B7D6-EBE05848F07A@microsoft.com... > Thanks for your reply , i was saying its problem with MDAC because i was > going through couple MSDN knowledge base issues and they suggested to > install > the MDAC latest srvice pack... > anyway here is my code..... > Dim db As Database = DatabaseFactory.CreateDatabase("Test") > Dim sqlCommand As String = "dbo.tsp_Test" > Dim dbCommandWrapper As DBCommandWrapper = > db.GetStoredProcCommandWrapper(sqlCommand) > With dbCommandWrapper > .AddInParameter("@username", DbType.String, "Test") > End With > ' DataSet that will hold the returned results > Dim productsDataSet As DataSet = Nothing > productsDataSet = db.ExecuteDataSet(dbCommandWrapper) > > please suggest.... > > "Paul Clement" wrote: > >> On Thu, 23 Mar 2006 16:29:01 -0800, vsr <v**@discussions.microsoft.com> >> wrote: >> >> ¤ I am getting the followign error when using ODBC from ADO.NET..... >> ¤ System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL >> Server >> ¤ Driver][SQL Server]Procedure 'StoredProcedure' expects parameter >> ¤ '@Parameter', which was not supplied. >> ¤ >> ¤ I installed latest MDAC , still i am getting error... >> ¤ any help? >> >> You're going to have to post your code and the parameter definitions of >> your stored procedure in >> order for us to troubleshoot this problem. >> >> This error has nothing to do with MDAC. >> >> >> Paul >> ~~~~ >> Microsoft MVP (Visual Basic) >> oh ....no.thats just typo error..adding the correct parameter name .......
Show quote "Stephany Young" wrote: > Well there is your problem. > > The input parameter to the stored procedure is named @Parameter but you are > adding a parameter called @username. > > > "vsr" <v**@discussions.microsoft.com> wrote in message > news:2A744FA0-3E1F-4BB9-B7D6-EBE05848F07A@microsoft.com... > > Thanks for your reply , i was saying its problem with MDAC because i was > > going through couple MSDN knowledge base issues and they suggested to > > install > > the MDAC latest srvice pack... > > anyway here is my code..... > > Dim db As Database = DatabaseFactory.CreateDatabase("Test") > > Dim sqlCommand As String = "dbo.tsp_Test" > > Dim dbCommandWrapper As DBCommandWrapper = > > db.GetStoredProcCommandWrapper(sqlCommand) > > With dbCommandWrapper > > .AddInParameter("@username", DbType.String, "Test") > > End With > > ' DataSet that will hold the returned results > > Dim productsDataSet As DataSet = Nothing > > productsDataSet = db.ExecuteDataSet(dbCommandWrapper) > > > > please suggest.... > > > > "Paul Clement" wrote: > > > >> On Thu, 23 Mar 2006 16:29:01 -0800, vsr <v**@discussions.microsoft.com> > >> wrote: > >> > >> ¤ I am getting the followign error when using ODBC from ADO.NET..... > >> ¤ System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL > >> Server > >> ¤ Driver][SQL Server]Procedure 'StoredProcedure' expects parameter > >> ¤ '@Parameter', which was not supplied. > >> ¤ > >> ¤ I installed latest MDAC , still i am getting error... > >> ¤ any help? > >> > >> You're going to have to post your code and the parameter definitions of > >> your stored procedure in > >> order for us to troubleshoot this problem. > >> > >> This error has nothing to do with MDAC. > >> > >> > >> Paul > >> ~~~~ > >> Microsoft MVP (Visual Basic) > >> > > > Where is the typo?
Are you saying that you typed the error message and the code fragment into your post and made a typo whilst doing so? If so, how do you expect anyone to be able to help you with your 'problem'? Copy and Paste is very good for avoiding typos. Show quote "vsr" <v**@discussions.microsoft.com> wrote in message news:7BB2BE6F-080C-4189-B6AF-B8BE7EF6D563@microsoft.com... > oh ....no.thats just typo error..adding the correct parameter name ....... > > "Stephany Young" wrote: > >> Well there is your problem. >> >> The input parameter to the stored procedure is named @Parameter but you >> are >> adding a parameter called @username. >> >> >> "vsr" <v**@discussions.microsoft.com> wrote in message >> news:2A744FA0-3E1F-4BB9-B7D6-EBE05848F07A@microsoft.com... >> > Thanks for your reply , i was saying its problem with MDAC because i >> > was >> > going through couple MSDN knowledge base issues and they suggested to >> > install >> > the MDAC latest srvice pack... >> > anyway here is my code..... >> > Dim db As Database = DatabaseFactory.CreateDatabase("Test") >> > Dim sqlCommand As String = "dbo.tsp_Test" >> > Dim dbCommandWrapper As DBCommandWrapper = >> > db.GetStoredProcCommandWrapper(sqlCommand) >> > With dbCommandWrapper >> > .AddInParameter("@username", DbType.String, "Test") >> > End With >> > ' DataSet that will hold the returned results >> > Dim productsDataSet As DataSet = Nothing >> > productsDataSet = db.ExecuteDataSet(dbCommandWrapper) >> > >> > please suggest.... >> > >> > "Paul Clement" wrote: >> > >> >> On Thu, 23 Mar 2006 16:29:01 -0800, vsr >> >> <v**@discussions.microsoft.com> >> >> wrote: >> >> >> >> ¤ I am getting the followign error when using ODBC from ADO.NET..... >> >> ¤ System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL >> >> Server >> >> ¤ Driver][SQL Server]Procedure 'StoredProcedure' expects parameter >> >> ¤ '@Parameter', which was not supplied. >> >> ¤ >> >> ¤ I installed latest MDAC , still i am getting error... >> >> ¤ any help? >> >> >> >> You're going to have to post your code and the parameter definitions >> >> of >> >> your stored procedure in >> >> order for us to troubleshoot this problem. >> >> >> >> This error has nothing to do with MDAC. >> >> >> >> >> >> Paul >> >> ~~~~ >> >> Microsoft MVP (Visual Basic) >> >> >> >> >> ok..here is the error ....
System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'dbo.tsp_Test' expects parameter '@username', which was not supplied. ---------------------------------------------------- Show quote "Stephany Young" wrote: > Where is the typo? > > Are you saying that you typed the error message and the code fragment into > your post and made a typo whilst doing so? > > If so, how do you expect anyone to be able to help you with your 'problem'? > > Copy and Paste is very good for avoiding typos. > > > "vsr" <v**@discussions.microsoft.com> wrote in message > news:7BB2BE6F-080C-4189-B6AF-B8BE7EF6D563@microsoft.com... > > oh ....no.thats just typo error..adding the correct parameter name ....... > > > > "Stephany Young" wrote: > > > >> Well there is your problem. > >> > >> The input parameter to the stored procedure is named @Parameter but you > >> are > >> adding a parameter called @username. > >> > >> > >> "vsr" <v**@discussions.microsoft.com> wrote in message > >> news:2A744FA0-3E1F-4BB9-B7D6-EBE05848F07A@microsoft.com... > >> > Thanks for your reply , i was saying its problem with MDAC because i > >> > was > >> > going through couple MSDN knowledge base issues and they suggested to > >> > install > >> > the MDAC latest srvice pack... > >> > anyway here is my code..... > >> > Dim db As Database = DatabaseFactory.CreateDatabase("Test") > >> > Dim sqlCommand As String = "dbo.tsp_Test" > >> > Dim dbCommandWrapper As DBCommandWrapper = > >> > db.GetStoredProcCommandWrapper(sqlCommand) > >> > With dbCommandWrapper > >> > .AddInParameter("@username", DbType.String, "Test") > >> > End With > >> > ' DataSet that will hold the returned results > >> > Dim productsDataSet As DataSet = Nothing > >> > productsDataSet = db.ExecuteDataSet(dbCommandWrapper) > >> > > >> > please suggest.... > >> > > >> > "Paul Clement" wrote: > >> > > >> >> On Thu, 23 Mar 2006 16:29:01 -0800, vsr > >> >> <v**@discussions.microsoft.com> > >> >> wrote: > >> >> > >> >> ¤ I am getting the followign error when using ODBC from ADO.NET..... > >> >> ¤ System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL > >> >> Server > >> >> ¤ Driver][SQL Server]Procedure 'StoredProcedure' expects parameter > >> >> ¤ '@Parameter', which was not supplied. > >> >> ¤ > >> >> ¤ I installed latest MDAC , still i am getting error... > >> >> ¤ any help? > >> >> > >> >> You're going to have to post your code and the parameter definitions > >> >> of > >> >> your stored procedure in > >> >> order for us to troubleshoot this problem. > >> >> > >> >> This error has nothing to do with MDAC. > >> >> > >> >> > >> >> Paul > >> >> ~~~~ > >> >> Microsoft MVP (Visual Basic) > >> >> > >> > >> > >> > > > the same code is working fine with SqlCommand , OleDBCommand its just failing
with ODBCCommand. Show quote "Stephany Young" wrote: > Well there is your problem. > > The input parameter to the stored procedure is named @Parameter but you are > adding a parameter called @username. > > > "vsr" <v**@discussions.microsoft.com> wrote in message > news:2A744FA0-3E1F-4BB9-B7D6-EBE05848F07A@microsoft.com... > > Thanks for your reply , i was saying its problem with MDAC because i was > > going through couple MSDN knowledge base issues and they suggested to > > install > > the MDAC latest srvice pack... > > anyway here is my code..... > > Dim db As Database = DatabaseFactory.CreateDatabase("Test") > > Dim sqlCommand As String = "dbo.tsp_Test" > > Dim dbCommandWrapper As DBCommandWrapper = > > db.GetStoredProcCommandWrapper(sqlCommand) > > With dbCommandWrapper > > .AddInParameter("@username", DbType.String, "Test") > > End With > > ' DataSet that will hold the returned results > > Dim productsDataSet As DataSet = Nothing > > productsDataSet = db.ExecuteDataSet(dbCommandWrapper) > > > > please suggest.... > > > > "Paul Clement" wrote: > > > >> On Thu, 23 Mar 2006 16:29:01 -0800, vsr <v**@discussions.microsoft.com> > >> wrote: > >> > >> ¤ I am getting the followign error when using ODBC from ADO.NET..... > >> ¤ System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL > >> Server > >> ¤ Driver][SQL Server]Procedure 'StoredProcedure' expects parameter > >> ¤ '@Parameter', which was not supplied. > >> ¤ > >> ¤ I installed latest MDAC , still i am getting error... > >> ¤ any help? > >> > >> You're going to have to post your code and the parameter definitions of > >> your stored procedure in > >> order for us to troubleshoot this problem. > >> > >> This error has nothing to do with MDAC. > >> > >> > >> Paul > >> ~~~~ > >> Microsoft MVP (Visual Basic) > >> > > > On Fri, 24 Mar 2006 06:57:02 -0800, vsr <v**@discussions.microsoft.com> wrote:
¤ Thanks for your reply , i was saying its problem with MDAC because i was ¤ going through couple MSDN knowledge base issues and they suggested to install ¤ the MDAC latest srvice pack... ¤ anyway here is my code..... ¤ Dim db As Database = DatabaseFactory.CreateDatabase("Test") ¤ Dim sqlCommand As String = "dbo.tsp_Test" ¤ Dim dbCommandWrapper As DBCommandWrapper = ¤ db.GetStoredProcCommandWrapper(sqlCommand) ¤ With dbCommandWrapper ¤ .AddInParameter("@username", DbType.String, "Test") ¤ End With ¤ ' DataSet that will hold the returned results ¤ Dim productsDataSet As DataSet = Nothing ¤ productsDataSet = db.ExecuteDataSet(dbCommandWrapper) ¤ I've never used the Data Application Block, but the sample on the below page doesn't use the "@" symbol to prefix parameter names. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/EntLibJan2006_DataAccessAppBlock.asp Paul ~~~~ Microsoft MVP (Visual Basic) Thanks for the Info , in the parameter we can use "@" or without that also we
can pass parameter names, internally MS Application Block checking for the "@" character. After lot of struggle i got the solution , for ODBC Commands we need to pass the special Command text and not just the name of the procedure.... for ex: SP Name : tsp_Sample and if this accepsts two parameters then command text should be like this.... Without Return Val : CommandText = "{call tsp_Sample(?,?)}" With Return Val : CommandText = "{call ?= tsp_Sample(?,?)}" and works fine... Thanks again all for the support. Show quote "Paul Clement" wrote: > On Fri, 24 Mar 2006 06:57:02 -0800, vsr <v**@discussions.microsoft.com> wrote: > > ¤ Thanks for your reply , i was saying its problem with MDAC because i was > ¤ going through couple MSDN knowledge base issues and they suggested to install > ¤ the MDAC latest srvice pack... > ¤ anyway here is my code..... > ¤ Dim db As Database = DatabaseFactory.CreateDatabase("Test") > ¤ Dim sqlCommand As String = "dbo.tsp_Test" > ¤ Dim dbCommandWrapper As DBCommandWrapper = > ¤ db.GetStoredProcCommandWrapper(sqlCommand) > ¤ With dbCommandWrapper > ¤ .AddInParameter("@username", DbType.String, "Test") > ¤ End With > ¤ ' DataSet that will hold the returned results > ¤ Dim productsDataSet As DataSet = Nothing > ¤ productsDataSet = db.ExecuteDataSet(dbCommandWrapper) > ¤ > > I've never used the Data Application Block, but the sample on the below page doesn't use the "@" > symbol to prefix parameter names. > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/EntLibJan2006_DataAccessAppBlock.asp > > > Paul > ~~~~ > Microsoft MVP (Visual Basic) > |
|||||||||||||||||||||||