473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DataReader and ComboBox BlankLine

People,

I trying to write a lookup combobox that gets it's data via a sql table.

I can populate the combobox with the information and have handled all
the filtering, how ever i can't seem to add a blank row to the combobox,
i have tried adding via the datatable and i can't seem to get that to
work. However is there a way via the datareader to populate the combobox
with a text value and id without assigning a object to the combobox.

Thanks Tim.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
3 1447
If your ComboBox is bound to the DataTable, adding a new row to the
DataTable should present a new entry in the ComboBox. Are you saying that
this is not the case ?

Regards - OHM

Tim Ford wrote:
People,

I trying to write a lookup combobox that gets it's data via a sql
table.

I can populate the combobox with the information and have handled all
the filtering, how ever i can't seem to add a blank row to the
combobox, i have tried adding via the datatable and i can't seem to
get that to work. However is there a way via the datareader to
populate the combobox with a text value and id without assigning a
object to the combobox.

Thanks Tim.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #2


Yep this sure is the case, i keep on getting a dbull=readonly error. any
idea??

Thanks Tim.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3
I created a similar scenario to you., albiet using a dataAdapter rather than
a DataReader,and was able to add something to the table with no problems.

Suggest that the first thing is to debug this and prove that you are adding
a row to your DataTable. You will not be able to add items directly to the
list while the control is bound I dont think.

Regards - OHM

Dim tr As DataRow = Ds1.Tables(0).NewRow()

tr(9) = "Crap"

Ds1.Tables(0).Rows.Add(tr)

Tim Ford wrote:
Yep this sure is the case, i keep on getting a dbull=readonly error.
any idea??

Thanks Tim.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Yasutaka Ito | last post by:
Hi, My friend had a little confusion about the working of DataReader after reading an article from MSDN. Following is a message from him... <!-- Message starts --> I was going thru DataReader...
6
by: Ravi | last post by:
Hi, I am not able to understand why a datareader needs a connection to the DB all the time. Here is what I tried. Sqlcommand cmd = ("select * from table1",con) // where con is the connection...
4
by: Annie | last post by:
hello guys, I am trying to bind the combobox using a dataread as below: but it doesn't work?? Do While (reader.Read) cboTest.DisplayMember = reader.Item("au_lname") cboTest.ValueMember =...
20
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
2
by: Andrei Pociu | last post by:
In a typical ASP .NET Web Application (website), I'm currently using a class where I declare some public static objects. For example there's the place where I initialize the SqlConnection. Also...
1
by: Brent | last post by:
I'm having a hard time wrapping my head around how to build a multi-dimensional array of n length out of a DataReader loop. Take this pseudo-code: ======================================= public...
7
by: Hardik Shah | last post by:
Hi, Generaly to populate combobox , I use following command :- Combobox1.datasource = dataset.tablename combobox1.displaymember = fieldname1 combobox1.valuemember = fieldname2 As I don't...
7
by: Varangian | last post by:
Hi all, the question I want to ask if the conversion of a DataReader to a Table looping through the DataReader is better than using the Fill Method of the DataAdapter... I'm asking because...
7
by: Diffident | last post by:
Hello All, I would like to use DataReader based accessing in my Data Access Layer (DAL). What is considered to be a best practice while returning from a DAL method that executes a query and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.