Code: Select all
string connString = "host=; user id=; database=;";
PgSqlConnection conn = new PgSqlConnection( connString );
PgSqlCommand command = new PgSqlCommand( "adaption.funcampaignstats", conn );
command.Parameters.Add( "adsf", PgSqlType.Int, 4, "1960" );
command.CommandType = CommandType.StoredProcedure;
PgSqlDataAdapter da = new PgSqlDataAdapter();
da.SelectCommand = command;
DataSet dataSet = new DataSet();
da.Fill( dataSet );
Response.Write( "0: " + dataSet.Tables[0].Rows[0][0] + "" );
Response.Write( "1: " + dataSet.Tables[0].Rows[0][1] + "" );
Response.Write( "2: " + dataSet.Tables[0].Rows[0][2] + "" );
Code: Select all
cannot EXECUTE a null querystring
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CoreLab.PostgreSql.PgSqlException: cannot EXECUTE a null querystring
Source Error:
Line 32:
Line 33: DataSet dataSet = new DataSet();
Line 34: da.Fill( dataSet );
Line 35:
Line 36: Response.Write( "0: " + dataSet.Tables[0].Rows[0][0] + "" );
Source File: c:\inetpub\wwwroot\regmanweb\mailing\pg_test.aspx.cs Line: 34
Stack Trace:
[PgSqlException: cannot EXECUTE a null querystring]
CoreLab.PostgreSql.PgSqlCommand.ExecuteReader(CommandBehavior behavior) +347
CoreLab.PostgreSql.PgSqlCommand.c(CommandBehavior A_0) +19
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
Regman.Web.Mailing.pg_test.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\regmanweb\mailing\pg_test.aspx.cs:34
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750