Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Bind crystal report to xml file it's input from created dataset ,the prob here that it's doesn't refresh each time i press the button the old values pops up
Is there is any way to solve it !!?

Code:
DataSet DS= CreateDataSet_TempEmp();

using (System.Data.SqlClient.SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ManPowerConnectionString"].ConnectionString))
{
con.Open();
SqlCommand Cmd = new SqlCommand();
Cmd.CommandType = CommandType.StoredProcedure;
Cmd.CommandText = "SP_Rprt_TempEmp";
Cmd.Connection = con;
Cmd.Parameters.Add("@Temp_File_No", SqlDbType.Int).Value = FileNo;
Cmd.Parameters.Add("@Qualification", SqlDbType.Int).Value = Qualifi;
Cmd.Parameters.Add("@Temp_Emp_Name", SqlDbType.NVarChar, 200).Value = EmpName;
Cmd.Parameters.Add("@Temp_BirthDate_From", SqlDbType.Date).Value = FrmDate;
Cmd.Parameters.Add("@Temp_BirthDate_To", SqlDbType.Date).Value = ToDate;
Cmd.Parameters.Add("@Temp_Dist", SqlDbType.Int).Value = Dist;
Cmd.Parameters.Add("@Temp_Disabled", SqlDbType.Bit).Value = Disabled;


SqlDataReader DR = Cmd.ExecuteReader();
if (DR.HasRows)
{
while (DR.Read())
{
DataRow Dr = DS.Tables["TempEmp"].NewRow();
Dr["Qualification"] = DR[0];
Dr["Temp_Emp_name"] = DR[1];
Dr["Temp_File_No"] = DR[2];
Dr["Temp_Birthdate"] = DR[3];
Dr["Disabled"] = DR[4];
Dr["Temp_Job"] = DR[5];
Dr["District"] = DR[6];
DS.Tables["TempEmp"].Rows.Add(Dr);
}
DR.Close();
//System.IO.File.Delete("c:\\TempEmp.xml");
DS.WriteXml("c:\\TempEmp.xml");
Response.Redirect("Rprt_TempEmp.aspx");
}
con.Close();
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900