Queries"Using access and oledbdatareader"

  • Thread starter Thread starter A.J
  • Start date Start date
A

A.J

I am building an application can store contact information of my
friends. Main features are : Insert the data, deletion of the data,
a drop down listbox is used for displaying the data.

1. The sample fields of the table are: uniqueid(auto
number),name(text),phone number(text),e-mail(text)

Now while inserting the data i am getting error if i am using the field
name "phone number" "e-mail".If i change the field name to
"phonenumber" "email" that error is removed and am able to insert the
data in the table. why so?

2. If one of my textbox name is txtName then what "txtName.Text"
returns and what is its data type?

3. I want the user to input the phone number in the format
####-####-##. How am i suppose to do this
 
I am using vb.net and it is a windows application not the usual
web-based application.

One more query:
ExecuteScalar returns single value form the datasource. While retriving
its value why we use datatype as Int32.
ex: dim flag as Int32 = CInt (cmd.ExecuteScalar)
 
¤ I am building an application can store contact information of my
¤ friends. Main features are : Insert the data, deletion of the data,
¤ a drop down listbox is used for displaying the data.
¤
¤ 1. The sample fields of the table are: uniqueid(auto
¤ number),name(text),phone number(text),e-mail(text)
¤
¤ Now while inserting the data i am getting error if i am using the field
¤ name "phone number" "e-mail".If i change the field name to
¤ "phonenumber" "email" that error is removed and am able to insert the
¤ data in the table. why so?
¤

Because the space is considered a delimiter when the SQL is parsed. Column names w/embedded spaces
should be enclosed by brackets (e.g. [phone number]).

¤ 2. If one of my textbox name is txtName then what "txtName.Text"
¤ returns and what is its data type?
¤

It returns the value in the TextBox and the data type is string.

¤ 3. I want the user to input the phone number in the format
¤ ####-####-##. How am i suppose to do this

Use a Masked Edit control:

http://makeashorterlink.com/?T3D12603B


Paul
~~~~
Microsoft MVP (Visual Basic)
 
¤ I am using vb.net and it is a windows application not the usual
¤ web-based application.
¤
¤ One more query:
¤ ExecuteScalar returns single value form the datasource. While retriving
¤ its value why we use datatype as Int32.
¤ ex: dim flag as Int32 = CInt (cmd.ExecuteScalar)

Probably because ExecuteScalar returns an Object, which needs to be converted to the data type of
the variable to which you are assigning the value.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top