By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,027 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,027 IT Pros & Developers. It's quick & easy.

adding a blank row to a combobox

P: n/a
Sam
hi,
I have a combox in a datagrid linked to a dataset. I fill the dataset
using my own customised class and it works fine.

da.AddTable("select FieldTypeID, FieldType from FieldTypes",
DatabaseAccess.SQLType.Text)
m_dsFields = da.GetDataset

Dim r As New DataRow
m_dsFields.Tables(1).Rows.Add(r)

However the 2 lines above where I try to add a blank row to my dataset
don't work. How can I do that ?
Thx

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
changing the select might fix it

select FieldTypeID, FieldType from FieldTypes union all "", ""

"Sam" <sa**************@voila.fr> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
hi,
I have a combox in a datagrid linked to a dataset. I fill the dataset
using my own customised class and it works fine.

da.AddTable("select FieldTypeID, FieldType from FieldTypes",
DatabaseAccess.SQLType.Text)
m_dsFields = da.GetDataset

Dim r As New DataRow
m_dsFields.Tables(1).Rows.Add(r)

However the 2 lines above where I try to add a blank row to my dataset
don't work. How can I do that ?
Thx

Nov 21 '05 #2

P: n/a

"JohnFol" <Ou************@WibbleObbble.Com> wrote in message
news:9S*******************@newsfe1-win.ntli.net...
changing the select might fix it

select FieldTypeID, FieldType from FieldTypes union all "", ""


That is really the simplest way to get this done.

Otherwise you'll have to create a new row using the DataTable object.
The row needs to be the same schema as the table so you have to create it
using the DataTable object.

Tom P.

Dim myNewRow as DataRow

myNewRow = myDataSet.Tables(0).NewRow

myNewRow(0)(0) = "<Empty>"

myDataSet.Tables(0).Rows.Add(myNewRow)
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.