hello experts..please help me..How can i solve this error...
Using db As New DB_CARRENTALEntities1
Dim x
Dim a = db.tbl_customer.Where(Function(b) b.cardesc = "studnum").FirstOrDefault
x = a.CustomerID + 1<<<<<(Object reference not set to an instance of an object.) how can i solve this error..
Dim newstudnum As String = "104-" & Format(Now, "yyyy") & "-" & Format(x, "000#")
TextBox1.Text = newstudnum
Dim d = db.tbl_customer.Where(Function(f) f.cardesc = "studnum").FirstOrDefault
Dim y As Integer
y = x
d.CustomerID = y
db.SaveChanges()
db.AcceptAllChanges()
cmdID.Enabled = False
End Using