string querystring = Request.QueryString["Userid"]; DataTable dtfrnameid = new DataTable(); connfordata.Open(); SqlCommand cmdfrnameid = new SqlCommand("select s000_UserId from s000_users where (s000_firstname+s000_lastname) = '" + querystring + "'", connfordata); SqlDataAdapter dafrnameid = new SqlDataAdapter(cmdfrnameid); dafrnameid.Fill(dtfrnameid); connfordata.Close(); string id = dtfrnameid.Rows[0][0].ToString(); lblfrogridview.Text = ""; string weekending = gvweeklysum.Rows[rindex].Cells[1].Text; DateTime getweekending = Convert.ToDateTime(weekending); DateTime dtmonday = getweekending.AddDays(-4); DateTime castdttime = dtmonday.AddHours(12); var monday = castdttime.Date.ToString("yyyy-MM-dd 12:mm:ss"); DataTable dtfrmonday = new DataTable(); connfordata.Open(); SqlCommand cmdfrmonday = new SqlCommand("SRTSWeeklySummaryWednesday", connfordata); SqlDataAdapter dafrmonday = new SqlDataAdapter(cmdfrmonday); cmdfrmonday.CommandType = CommandType.StoredProcedure; cmdfrmonday.Parameters.Add(new SqlParameter("@createddate", SqlDbType.DateTime)).Value = monday; cmdfrmonday.Parameters.Add(new SqlParameter("@userid", SqlDbType.Int)).Value = id; dafrmonday.Fill(dtfrmonday); connfordata.Close();
/*Export datatable to xml */ dtfrmonday.TableName = "MyTable"; dtfrmonday.WriteXml("Path\FileName.xml", XmlWriteMode.WriteSchema); /*Import xml to datatable */ dtfrmonday.TableName = "MyTable"; dtfrmonday.ReadXml("Path\FileName.xml");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)