help in VB.net + ms access

chihcc

New member
Joined
Sep 30, 2006
Messages
3
Programming Experience
Beginner
i juz develop a program that require me to insert a data from textbox into database

textbox data look like:

------
tuyi
toup
eryu
eyu
-------

how can i insert data into database(1 field only such as Name ) by just press a single button?
hope anyone can help me out..
 
i had try to add a database row like below,but still cant success,can anyone tell me why??i'm using VB.net 2003 + access

Dim objTable As DataTable
Dim drRows As DataRowCollection
Dim objDs As DataSet
Dim objNewRow As DataRow


objTable = objDs.Tables("kk")
Dim arry(0) As Object
arry(0) = "uuu"
objNewRow = drRows.Add(arry)

The error occur like this :

An unhandled exception of type 'System.NullReferenceException' occurred in connection.exe

Additional information: Object reference not set to an instance of an object.


I had try different method for demo a add database row,but always occur the same error message..
 
Dim drRows As DataRowCollection

You hav declared the variable here but not set it to an instance of anything, so it will cause a NullReferenceException to be raised
 
Incidentally, I would suggest that noone really wants to answer the question because there are many tutorials already out there, about how to insert data into databases.. If you have no luck finding any on google, feel free to ask if anyone here has a good tutorial they know of.
 
Back
Top