Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi every body, i am beginer in both linq to sql and n-tier applications, i made a project using Northwind database in vb.net, i have a problem with insert operation about null value error message, i made a sub to insert values in customers table it is as follows

public sub inscust(ByVal u as customer)

dim db as NorthWindDataContext=new NorthWindDataContext()

db.customers.insertonsubmit(u)

db.submitchanges()
end sub

this sub is in DataEntityTier ( intermediate layer )
in the presentation tier i called that sub as follows

Dim t as DataEntityTier.customer= new DataEntityTier.customer

Dim db as DataEntityTier.NorthWindDataContext= new NorthWindDataContext()

t.CustomerID= customersDataGridView.Rows(0).Cells(0).Value.ToString()
t.ComPanyName= customersDataGridView.Rows(0).Cells(1).Value.ToString

and i have made all columns then i called th inscust sub
Dim a As DataEntityTier.Class1 = new DataEntityTier.Class1()

a.inscust(t)
when running the application an bug and error message appear about null value
i want the insert operation allows null value
when i run i fill all columns of the datagridview . thanks dears
Posted
Comments
ZurdoDev 20-Jul-13 23:16pm    
Please click the improve question link and add code tags around your code. Also, it seems like you should be able to debug this and find the issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900