Home » Archive by category "MS SQL"

Archive for the 'MS SQL' Category

VB.NET – Limited user (checkbox) selection

I found this script very helpful while designing surveys for my organization. This post applies to: – MS SQL server 2005+ – VB.NET – VS2010 – .NET 4.0 Framework Javascript code <asp:content ID=”Content1″ ContentPlaceHolderID=”HeadContent” Runat=”Server”> <script type=”text/javascript” language=”javascript”> function CheckCheck() { var chkBoxList = document.getElementById(‘< %=CheckBoxList1.ClientID %>’); var chkBoxCount = chkBoxList.getElementsByTagName(“input”); var btn = document.getElementById(‘< [...]

SQL Primary Key Constraint on alter table

- Login to your server MS SQL Management Studio Express – Expand the database; expand the tables folder, right click on the table “[your table name]“, click “Open Table.” Make sure the primary key column(s) have been declared to not contain NULL values (when the table was first created). With the open table click on [...]

VB.NET – Parameters

Parameter default value in code behind SQL Datasource <asp:sqldatasource ID=”ServiceExpired” runat=”server” ConnectionString=”< %$ ConnectionStrings:intranetConnectionString2 %>” SelectCommand=”SELECT * FROM [Invoice] _ WHERE _ ([EXPIRATION_DATE] >= @EXP_BEG) _ 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_BEG” Type=”DateTime”/> <asp:parameter Name=”EXP_END” Type=”DateTime”/> </selectparameters> [...]