Thursday, August 27, 2009

LINQ Unleashed: for C#



Download

Saturday, August 22, 2009

sql CookBook



Download Here

Friday, August 21, 2009

Silverlight For Asp.net



click Here to download

Thursday, August 20, 2009

Rs Aggarwal Reasoning Download

click here to download Rs Aggawalbook

Sql Server In 21 Days

Download Here

Wednesday, August 19, 2009

sql the complete reference

Click Here to Download

Tuesday, August 18, 2009

Add, Edit and Delete using the ASP.NET ListView Control

Monday, August 17, 2009

ASP.NET 2.0 Nested GridView

Wednesday, August 12, 2009

Read Text File and Display in Grid View

protected void Page_Load
(object sender, EventArgs e)
{
if (!IsPostBack)
{
string openpath, contents;
int tabsize = 4;
string[] arinfo;
string line;
int i;
DataTable dt = CreateTable();
DataRow row;
try
{
openpath =
Server.MapPath(".") + @"\abhi.txt";
string filename = openpath;
StreamReader st;
st = File.OpenText(filename);
while ((line = st.ReadLine()) != null)
{
contents =
line.Replace(("").PadRight(tabsize, ' '), "\t");
char[] textdelimeter = { ']' };
arinfo = contents.Split(textdelimeter);
for (i = 0; i < arinfo.Length; i++)
{
row = dt.NewRow();
if (i < arinfo.Length)
row["name"] = arinfo[i].ToString().Replace("[", "");
if (i < arinfo.Length)
row["lastname"] = arinfo[i].ToString().Replace("[", "");
dt.Rows.Add(row);
}
i++;

}
st.Close();
GridView1.DataSource = dt;
GridView1.DataBind();
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}


}


}


private DataTable CreateTable()
{
try
{
DataTable table = new DataTable();

// Declare DataColumn and DataRow variables.
DataColumn column;

// Create new DataColumn, set DataType, ColumnName
// and add to DataTable.
column = new DataColumn();
column.DataType = System.Type.GetType("System.String");
column.ColumnName = "name";
table.Columns.Add(column);

// Create second column.
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "lastname";
table.Columns.Add(column);


return table;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
}