Let’s say you have two tables that include towns and cities and you also have two fields in an entity that you have to keep the town and city of customer address. All you want to do is to load towns that are valid for the selected city only. Below you will find how to [...]
You can set NULL values for datetime values in your update parameters by using DBNull.value. SqlPar(0) = New SqlClient.SqlParameter("@CreatedOn", DBNull.Value) You can not use vbnull for null values. It sets the date to the lowest available value which varies (2.1.1900 for me).
You can download sample databases for Microsof SQL Server 2008 or Microsoft SQL Server 2005 from CodePlex.
You have to use the “ROW_NUMBER() OVER” command to give ids to the records you have in your query. A full command including “ROW_NUMBER OVER” is as the following: SELECT ROW_NUMBER() OVER (ORDER BY Column1 ASC) AS RowNo, Column1, Column2, Column3, Column4 FROM Table1 RowNo will be your ID here from 1 to the number [...]