I 've created a function sp_getText that returns a set of my detined type (named result_text) in postgre database.
I create a conn, command and dataAdapter in the c#net.
Code: Select all
PgSqlParameter param = null;
param = new PgSqlParameter( , )
param.Direction = ParameterDirection.Input;
param.PgSqlType = PgSqlType.VarChar;
param = new PgSqlParameter( , )
param.Direction = ParameterDirection.Input;
param.PgSqlType = PgSqlType.Int;
command.Parameters.Add(param);
//set the stored procedure name
command.CommandText = "sp_getText";
command.CommandType = CommandType.StoredProcedure;
dataAdapter = new PgSqlDataAdapter(command);
DataSet tmpDs = new DataSet();
//fill the data in the required data table
dataAdapter.Fill(tmpDs,"test");
Code: Select all
System.FormatException: Input string was not in a correct format.
Code: Select all
Stack trace:
[FormatException: Input string was not in a correct format.]
CoreLab.PostgreSql.PgSqlCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
CoreLab.Common.DbCommandBase.b(CommandBehavior A_0)
CoreLab.Common.DbCommand.a(CommandBehavior A_0)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
Seavus.DataBaseTier.DBBase.executeResults(String procName, Hashtable inParamTypes, Hashtable inParamValues, String srcTable) in e:\seavus\korthuset-postgre\svsdatabasetier\dbbase.cs:83
Seavus.DataBaseTier.DBText.getLanguageText(String page, Int32 language) in e:\seavus\korthuset-postgre\svsdatabasetier\dbtext.cs:35
korthuset_net.index.setMasterText() in E:\Seavus\Korthuset-postgre\index.aspx.cs:87
korthuset_net.index.Page_Load(Object sender, EventArgs e) in E:\Seavus\Korthuset-postgre\index.aspx.cs:38
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
Regards
Daniela