SCM

[#1000835] NRE in Npgsql.NpgsqlCommandBuilder.GetUpdateCommand

View Trackers | Bugs | Download .csv | Monitor

Date:
2006-12-11 16:59
Priority:
3
State:
Open
Submitted by:
Andrus Moor (kobruleht)
Assigned to:
Nobody (None)
Npgsql Version:
None
Category:
Group:
Resolution:
None
Summary:
NRE in Npgsql.NpgsqlCommandBuilder.GetUpdateCommand

Detailed description
To reproduce:

Run the code in .NET 2 in Windows XP

Observed:

System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Npgsql"
StackTrace:
at Npgsql.NpgsqlCommandBuilder.BuildSchema()
at Npgsql.NpgsqlCommandBuilder.GetUpdateCommand(DataRow row, Boolean setParameterValues)
at Npgsql.NpgsqlCommandBuilder.GetUpdateCommand(DataRow row)
at ConsoleApplication1.Program.Main(String[] args) in C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\ConsoleApplication1\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Code to reproduce:

using System.Data;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Npgsql.NpgsqlDataAdapter DataAdapter = new Npgsql.NpgsqlDataAdapter();
Npgsql.NpgsqlCommandBuilder builder =
new Npgsql.NpgsqlCommandBuilder(
(Npgsql.NpgsqlDataAdapter)DataAdapter);
DataSet DataSet = new DataSet();
DataSet.ReadXml(@"c:\hell.xml");

DataRow row = DataSet.Tables[0].Rows[1];
DataAdapter.UpdateCommand = builder.GetUpdateCommand(row);
System.Windows.Forms.MessageBox.Show(DataAdapter.UpdateCommand.CommandText );
}
}
}

Followup

No Followups Have Been Posted

Attached Files:

Attachments:
hell.zip

Changes:

Field Old Value Date By
File Added150: hell.zip2006-12-11 16:59kobruleht
Powered By FusionForge