I am trying to make a form in vb and connect that to database .First of all i created a databse and then opened new project and tried to connect that database to form.
file new--->try____>project--->add new item---->Service based databse--dataset---->finish
step2----->in databse explored right clicked on table and Add table
filled the coloums like this
firstname nchar50 null
lastname nchar50 null
saved the table
created another table and attached the for with trydatabase
It shows me this error when i place detail view on form

Value of '1/1/0001 12:00:00 AM' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
Parameter name: Value pointing to this codeMe.TrytableTableAdapter.Fill(Me.Database2DataSet.trytable)

Recommended Answers

All 2 Replies

BY default, and unassigned date will be 1/1/0001. The Table Adapater is saying that although this is acceptable in .NET, Sql Server does not allow dates that are that early (year 1 or 0001). You have to assign the date before you can save the data. uIf yo want, you can give the date a nullable value 'System.Nullable(Date)' or just 'Date?. Then the date will not have to set in the data able, or the database.

Thanks for reply.But i found the solution yesterday.In datasource when we click a table we get detailed view etc and customise option .I clicked customise option i found that default was date picker changed it to textbox and problem got soloved.The problem used to display when i had no date coloumn in table.Thanks again for reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.