Click to See Complete Forum and Search --> : fill dataset with null value


jayson_13
November 29th, 2002, 08:09 PM
guys, i have a few problems here. hope u can help me. any code sample will be appreciated. TQ!

1) when i fill my dataset, i got this error "NO_DATA-No error information available". Actually my record consists of a few columns which is null value so i think that is why the error occur. because if all the columns selected has value i wont get this error. so now my problem is how to fill the dataset with null values? if cannot how can i convert the value? how to use invalidcastexception to convert the value?

dim conn as new odbcConnection(strconn)
dim da as new odbcDataAdapter("select * from recordm",conn)
dim ds as new DataSet()
da.fill(ds,"recordm") <---- here the error happen!
datagrid1.SetDataBinding(ds,"recordm")


2) how to set focus on the next control in the form. i have form that consist of few tabpages and around 40 textboxes. when user press enter key i want to set focus on next textbox without doing a event handler for each control. I enabled the form.keypreview and increment the tabindex on each enter key. but the focus will not jump to next control.

3) in the textbox i want to do some input masking. some for date(dd-MM-yy) and some for integer and decimal. how can i do it directly in design time?

tq! i know some of the questions are simple but i dunno y i couldn't solve it.

mselect
December 2nd, 2002, 12:34 PM
Hi,
Excuse my bad english ;)
Concerning §2 :
In the keypress event of the form whose keypreview property is set to "true", try this :

if keyascii = 13 then keyascii = 0: Sendkeys "{TAB}", true

It should work !!!
In addition, imagine you have a multiline text box (named Text1) where it has not to be applied, you can write :

if keyascii = 13 then

keyascii = 0: Sendkeys "{TAB}", true

mselect
December 2nd, 2002, 12:35 PM
Hi,
Excuse my bad english ;)
Concerning §2 :
In the keypress event of the form whose keypreview property is set to "true", try this :

if keyascii = 13 then keyascii = 0: Sendkeys "{TAB}", true

It should work !!!
In addition, imagine you have a multiline text box (named Text1) where it has not to be applied, you can write :

if keyascii = 13 then
if not Me.activecontrol is Text1 then keyascii = 0: sendkeys "{TAB}", true
end if