Hi Omar,
I think the SQL statement is passed to the SqlServer by the .Net
application, and it will be handled by the SqlServer, so it is not
case-sensitive.
While binding the ComboBox's DisplayMember property with certain field of
database, this field is already the column of DataSet and it is processed
in .Net, so it is case-sensitive.(I think this is determined by the design
of DisplayMember property).
I am glad you finally found the problem, I think we all must be careful of
this type of problem.
Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Reply-To: "Omar" <none>
| From: "Omar" <none>
| References: <uX************ **@tk2msftngp13 .phx.gbl>
| Subject: Re: problem binding comboBox to dataset
| Date: Thu, 9 Oct 2003 12:16:35 -0500
| Lines: 48
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#U************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 66-50-71-48.prtc.net 66.50.71.48
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1902 86
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| I finally found the answer. Apparently, the field in
| comboBox.Displa yMember is case-sensitive (at least for SQL Server 2000).
| The funny thing is that the sql statement used to fill the dataset is
*not*
| case-sensitive.
|
| Thanks again for the help.
|
|
| "Omar" <none> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
| > When I try to databind my comboBox (specifically field "emplcode") to a
| > filled dataset , the contents of the comboBox displays a bunch of
| > "System.Data.Da taRowView". I assume the amount of times
| > "System.Data.Da taR..." is displayed inside the combobox is the amount of
| > records in the dataset. On the other hand, if my query is "select
emplcode
| > from payemployee", the databind will work fine (but I don't want to
limit
| > the dataset to one field). Any help is appreciated. This is the code:
| >
| > DataSet DS_Employees = new DataSet();
| >
| > SqlConnection SQLConn = new SqlConnection(" Data Source=localhos t;
| Integrated
| > Security=SSPI;" +
| >
| > "Initial Catalog=payroll ");
| >
| > string strThisQuery = "select * from payemployee"; //If the query were
| > "select emplcode from payemployee" it works
| >
| > SqlDataAdapter DA_empl = new SqlDataAdapter (strThisQuery, SQLConn);
| >
| > DA_empl.Fill(DS _Employees, "payemploye e"); //Do I need the 2nd
parameter?
| >
| > SQLConn.Close() ;
| >
| > comboBox_emplco de.DataSource = DS_Employees.Ta bles["payemploye e"];
| >
| > comboBox_emplco de.DisplayMembe r = "emplcode"; //I also tried
| > comboBox_emplco de.DisplayMembe r = "payemployee.em plcode";
| >
| >
| >
| > Thanks again,
| >
| > Omar
| >
| >
|
|
|