Home » 2011 » November

Archive for November, 2011

Arithmetic overflow error converting expression to data type datetime

Condition: <asp:SqlDataSource ID=”PolExpCurrentMo” runat=”server” ConnectionString=”< %$ ConnectionStrings:appConnectionString2 %>” SelectCommand=”SELECT * FROM [VendorList] WHERE _([EXPIRATION_DATE] >= @EXP_BEGIN) AND ([EXPIRATION_DATE] < @EXP_END) AND _([EXPIRATION_CONTACT] = @EXPIRATION_CONTACT) ORDER BY EXPIRATION_DATE "> <selectparameters> <asp:parameter DefaultValue=”YES” Name=”EXPIRATION_CONTACT” Type=”String” /> <asp:parameter Name=”EXP_BEGIN” Type=”String”/> <asp:parameter Name=”EXP_END” Type=”String” /> </selectparameters> Code behind default value ‘ *current months date parameter PolExpCurrentMo.SelectParameters(“EXP_BEGIN”).DefaultValue = _DateTime.Now.Month.ToString() + […]

Month, day and year code behind format

Day name and date format of Friday, 11/11/2011 Dim strDayName As String Dim curTime As New DateTime curTime = DateTime.Now.ToShortDateString() strDayName = curTime.DayOfWeek.ToString Response.Write(strDayName & “, ” & DateTime.Today) Result: Friday, 11/11/2011 Day name and date format of Friday, 11/11/2011 using case funtion Dim iDay As String Dim strDayName As String iDay = DatePart(“w”, DateTime.Now) […]

Flag image

Very often I find reason for using flag in gridview to visually present different options to a user. So, to keep them handy and retrievable whenever I need flags, I decided to upload them on the website for personal and public use. Use them free as you need them and save the time to yourself […]