When I try to enter a null value for DataTime in Database I get error message ‘String was not recognized as a valid DateTime’ or ‘Value of type ‘System.DBNull’ cannot be converted to ‘String”
Use namespace System.Data.SqlTypes VB.NET Dim sqldatenull As SqlDateTime sqldatenull = SqlDateTime.Null If (txtDate.Text = ”) Then cmd.Parameters(‘@Date’).Value = sqldatenull ’cmd.Parameters(‘@Date’).Value = DBNull.Value Else cmd.Parameters(‘@Date’).Value = DateTime.Parse(txtDate.Text) End If C# if (txtDate.Text == ”) { cmd.Parameters [‘@Date’].Value =sqldatenull ; //cmd.Parameters[‘@Date’].Value = DBNull.Value; } else { cmd.Parameters[‘@Date’].Value = DateTime.Parse(txtDate.Text); }
How to open a browser window with maximum size on click of a button
VB.NET Button1.Attributes.Add(‘onclick’, ‘window.open(’page2.aspx’,’’,’fullscreen=yes’)’) C# Button1.Attributes.Add(‘onclick’, ‘window.open(’page2.aspx’,’’,’fullscreen=yes’)’);
What is the difference between CurrentCulture property and the CurrentUICulture property
CurrentCulture property : affects how the .NET Framework handles dates, currencies, sorting and formatting issues CurrentUICulture property : determines which satellite assembly is used when loading resources
What are the differences between HTML versus Server Control?
Refer ASP.NET Server Controls Recommendations Introduction to ASP.NET Server Controls
Why do I get a blank page when I use Server.Transfer(‘page1.htm’) to transfer to a different page
Server.Transfer only works with .aspx pages You can’t use Transfer method with HTML pages