|
-
Feb 3rd, 2006, 07:41 AM
#1
Thread Starter
Fanatic Member
Populate a combo
What i am doing wrong?
This is a code to populate a combobox.
Utilitarios oUtil=new Utilitarios();
sqlquery="Select * from area_caja order by descripcion";
cboarea.DataSource= oUtil.CreateDataSet(sqlquery);
cboarea.DisplayMember = "descripcion";
where CreateDateSet is:
public DataSet CreateDataSet(string sqlstring)
{
Utilitarios oUtil=new Utilitarios();
cn.ConnectionString = oUtil.GetConnectionstring();
OleDbCommand Cmd = new OleDbCommand (sqlstring, cn);
OleDbDataAdapter da = new OleDbDataAdapter(Cmd);
DataSet ds = new DataSet();
da.Fill(ds);
cn.Close();
return ds;
}
The problem is that the text displayed on the combo is:
System.Data.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|