c# - Pervasive SQL System Stored Procedure from ADO.NET error -


i'm trying return list of columns , attributes through system stored procedure. documentation have seems below code should work, "pervasive.data.sqlclient.lna.k: [lna][pervasive][odbc engine interface]invalid or missing argument." on execute. psql v11, .net 4.5.

using (psqlconnection conn = new psqlconnection(cs))     {         psqlcommand locationcmd = new psqlcommand();         psqlparameter tableparam = new psqlparameter();         psqlparameter returnparam = new psqlparameter();         returnparam.direction = parameterdirection.returnvalue;         locationcmd.commandtext = "psp_columns";         locationcmd.connection = conn;         locationcmd.commandtype = commandtype.storedprocedure;         locationcmd.parameters.add(tableparam).value = table;         locationcmd.parameters.add(returnparam);         conn.open();         locationcmd.executenonquery();      } 

i think problem line:

  locationcmd.parameters.add(tableparam).value = table; 

you should set value before adding parameter, not afterwards.

  tableparam.value = table;   locationcmd.parameters.add(tableparam); 

i don't know psql mssql need define parameter name found in stored procedure, or @ least that's do.

  sqlparameter param = new sqlparameter("@tableparam", value); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -