hi i want to store date from the database into an array......
here is my code:
dim tm() as date
dim got as integer
and i'm getting this error....when i use it...
Private
Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadNotifyIcon1.Text =
"B'Day S/W" Call conn()cmd =
New OleDbCommand("select * from login", cn)dr = cmd.ExecuteReader
While dr.Read If (dr("pwd") = "") Then ElseGroupBox1.Hide()
End If End Whilecmd =
New OleDbCommand("select * from bday", cn)dr = cmd.ExecuteReader
While dr.Read If (dr("AlarmDate") = Date.Today) Thengot = got + 1
tm(got) = dr(
"AlarmTime") ------------>>> i get the error in this line:: End If End Whiletemp = got
Error is "Object reference not set to an instance of an object."
Please help meeee
Sriram RamaniPosted Feb 2, 2009, 10:13 AM
i want to know how to use an array without declaring the size....that is ex:
dim a() as integer
instead of
dim a(2) as integer
since i do not know the exact size
Sriram RamaniPosted Feb 1, 2009, 10:15 AM
Mahesh ChandPosted Jan 31, 2009, 12:25 PM
Your tm is null. It does not have a size defined. Read this document to learn how to create arrays in VB.NET.
http://www.vbdotnetheaven.com/UploadFile/ssivkumar/ExploringArrays04212005060650AM/ExploringArrays.aspx