[Mono-bugs] [Bug 75405][Nor] New - Problem with SQLServer GUID parameters

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jun 28 08:05:23 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by informatique.internet at fiducial.fr.

http://bugzilla.ximian.com/show_bug.cgi?id=75405

--- shadow/75405	2005-06-28 08:05:23.000000000 -0400
+++ shadow/75405.tmp.2169	2005-06-28 08:05:23.000000000 -0400
@@ -0,0 +1,73 @@
+Bug#: 75405
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data.SqlClient
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: informatique.internet at fiducial.fr               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Problem with SQLServer GUID parameters 
+
+I've an issue with MSSQL Server and mono...
+I just do a select * where fiche_id=@fiche_id
+and fiche_id is a Guid parameters... MS.NET return something, mono returns 
+nothing;
+here's my code :
+(do an insert with a name and a guid primary key before)
+class MainClass
+{
+        static string cnx="packet size=4096;user id=sa;password=sa;data 
+source=10.69.100.93;persist security info=false;initial 
+catalog=Fiche_Produit";
+
+
+        public static void Main(string[] args)
+        {
+                Console.WriteLine("Hello World!");
+                string requete="SELECT * FROM FICHE";
+                SqlCommand cmd=new SqlCommand();
+                SqlDataAdapter dta=new SqlDataAdapter(cmd);
+                DataSet ds=new DataSet();
+                cmd.Connection=new SqlConnection(cnx);
+                cmd.CommandText=requete;
+                dta.Fill(ds,"fiche");
+                Console.WriteLine("Select effectué");
+                Console.WriteLine(ds.DataSetName);
+                foreach (DataColumn col in ds.Tables["fiche"].Columns)
+                {
+                        Console.WriteLine(col.ColumnName);
+                }
+                Guid found=Guid.Empty;
+                foreach (DataRow row in ds.Tables["fiche"].Rows)
+                {
+                        Guid id=(Guid)row["FICHE_ID"];
+                        string titre=(string)row["FICHE_TITRE"];
+
+                        Console.WriteLine("ID :"+ id.ToString()+ " : "+titre);
+                        if (titre=="essai")
+                        {
+                                Console.WriteLine("Fiche Trouvée");
+                                found=id;
+                        }
+                }
+                        SqlCommand sqlc=new SqlCommand();
+                        sqlc.CommandText= @"SELECT * FROM Fiche 
+                                WHERE 
+                                                fiche_id=@fiche_id"; 
+                        sqlc.Parameters.Clear(); 
+                        sqlc.Parameters.Add("@fiche_id",SqlDbType.UniqueIdentifier).Value=found;
+                        sqlc.Connection=new SqlConnection(cnx);
+                        dta=new SqlDataAdapter(sqlc);
+                        ds=new DataSet();
+                        dta.Fill(ds,"fiche");
+                        Console.WriteLine(ds.Tables["fiche"].Rows.Count);
+        }
+}


More information about the mono-bugs mailing list