[Mono-dev] problem with mono 1.1.12.1

Daniel Morgan monodanmorg at yahoo.com
Tue Dec 27 12:37:43 EST 2005


mcs uses .net 1.1 profile as default.  gmcs uses .net 2.0 profile as default.  
   
  It looks like to be a regression in order to stub out methods and properties to support ADO.NET 2.0.

http://svn.myrealbox.com/viewcvs/trunk/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs?rev=53301&view=markup

Please file a bug report at http://bugzilla.ximian.com/
   
  Joe Audette mentioned this earlier in an email with a subject of "ASP.NET 2.0 databinding to a DropDwonList not implemented".  He also blogged about this problem on Monologue at 
  http://www.joeaudette.com/Default.aspx?pageid=101
   
  
cartuchoGL <cartuchogl at unrealspace.com> wrote:
  Hello,

I have a program will use Datasets and run fine with mono 1.1.9 compiled 
with gmcs, but with
1.1.12.1 throw an exception System.NotImplementedException, the same app 
compiled with mcs not fail.

This piece of code fail when run if compiled with gmcs

//* gmcs -warn:4 Example10.cs -r:System.Data -r:Npgsql */
using System;
using System.Data;
using Npgsql;
/*
CREATE TABLE table2(
field_int2 int2,
field_timestamp timestamp,
field_numeric numeric
);
*/
public class Example10 {
public static void Main() { 
string strCon =
"Server=localhost;"+
"User Id=postgres;"+
"Password=xxxx;"+
"Database=tests;";
NpgsqlConnection conn = new NpgsqlConnection(strCon);
conn.Open();

NpgsqlDataAdapter da = new NpgsqlDataAdapter();
DataSet ds = new DataSet();

string strCommand = "SELECT * FROM table2 WHERE 1=2";
NpgsqlCommand selCommand = new NpgsqlCommand(strCommand,conn);
selCommand.CommandType = CommandType.Text;

strCommand = "INSERT INTO table2 "+
"(field_int2,field_timestamp,field_numeric) "+
"VALUES (:a, :b, :c)";
NpgsqlCommand insCommand = new NpgsqlCommand(strCommand,conn);

insCommand.Parameters.Add
(new NpgsqlParameter("a", DbType.Int16));
insCommand.Parameters.Add
(new NpgsqlParameter("b", DbType.DateTime));
insCommand.Parameters.Add
(new NpgsqlParameter("c", DbType.Decimal));

insCommand.Parameters[0].Direction =
insCommand.Parameters[1].Direction =
insCommand.Parameters[2].Direction =
ParameterDirection.Input;

insCommand.Parameters[0].SourceColumn =
"field_int2";
insCommand.Parameters[1].SourceColumn =
"field_timestamp";
insCommand.Parameters[2].SourceColumn =
"field_numeric";

da.SelectCommand = selCommand;
da.InsertCommand = insCommand;

da.Fill(ds,"table2");

DataTable dt = ds.Tables["table2"];

DataRow dr = dt.NewRow();
dr["field_int2"] = 4;
dr["field_timestamp"] = new DateTime(2003, 03, 03, 14, 0, 0);
dr["field_numeric"] = 7.3M;

dt.Rows.Add(dr);

da.Update(ds,"table2");

conn.Close();
}
}

Output is:
Unhandled Exception: System.NotImplementedException: The requested 
feature is not implemented.
in <0x0001d> System.Data.Common.DbDataAdapter:get_SelectCommand ()
in <0x0001a> System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet 
dataSet, System.String srcTable)
in (wrapper remoting-invoke-with-check) 
System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,string)
in <0x0031e> Example10:Main ()

Any ideas?
Thanks.


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
  


		
---------------------------------
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051227/45982f9e/attachment.html 


More information about the Mono-devel-list mailing list