Friday, November 14, 2008

Get the Number of Days in a Month in Sql Server 2005

Get the Number of Days in a Month [Sql Server 2005]
Using SQL statement or SQL Query to calculating the Number of Days in a Month

SELECT convert(varchar,datepart(dd,DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())+1,0))))

Sunday, October 28, 2007

SQLServer 2005

How to enable "sa" login in SqlServer 2005



ALTER LOGIN sa ENABLE ;

ALTER LOGIN sa WITH PASSWORD = 'setyourpassword' ;

Sunday, October 7, 2007

Asp.Net

How to Create a DataTable Dynamically(Asp.Net 2.0 – C#)

DataTable DT = new DataTable("StudentTable");
DT.Columns.Add("StudentName");
DT.Columns.Add("Sub1");
DT.Columns.Add("Sub2");
DT.Columns.Add("Sub3");
DT.Columns.Add("Sub4");
DT.Columns.Add("Sub5");
DT.Columns.Add("Sub6");
DT.Columns.Add("Total");
DataTable myDT = new DataTable();
myDT = DT;
DataRow dr = myDT.NewRow(); // Create new DataTable and DataRow Object
dr["StudentName"] = "Mitesh";
dr["Sub1"] = "10";
dr["Sub2"] = "20";
dr["Sub3"] = "30";
dr["Sub4"] = "40";
dr["Sub5"] = "50";
dr["Sub6"] = "60";
dr["Total"] = "210";
myDT.Rows.Add(dr);