Hey Guys, thanks for your help!
But I found a little bit different solution, maybe not so optimal and beautiful but it works:
StreamWriter objW;
objW = File.CreateText(Server.MapPath("Reports/"+lblPrID.Text.ToString()+".csv"));//"C:\\Inetpub\\
objW.WriteLine("ProjectID;JobID;PlannedCost;Confrimed by Client;Actual Cost;USD or Rubles;Invoice to Date;Payment from Client;Payment to Partner;Start Date;End Date;Total Spots;GRP;GRP30;Target Audience;Reach 1+;Reach 3+;Reach 5+;Job Description;Media;Detail Media;SubDetail Media;Job Status;ManagerID;Printed;CPP/CPR;CPT;");
sqlConnection.Open();
SqlCommand cmdGetJobs = new SqlCommand("SELECT * FROM Job WHERE ProjectID='"+lblPrID.Text.ToString()+"'",sqlConnection);
SqlDataReader readJobs;
readJobs = cmdGetJobs.ExecuteReader();
string strJobID,strJDescription,strPlannedCost,strConfirmedByClient,strActualCost,strMonitoring;
string strDolOrRub,strInvoiceToDate,strPaymentFClient,strPaymentTPartner,strJobDateB,strJobDateE;
string strTotalSpots,strGRP,strGRP30,strTargetAudience,strR1,strR3,strR5,strJobType,strSubJobType;
string strSubSubJobType,strJobStatus,strManagerID,strPrinted,strCPPCPR,strCPT;
while (readJobs.Read())
{
strJobID = readJobs.GetString(1);
strJDescription = readJobs.GetString(3);
strPlannedCost = readJobs.GetInt32(4).ToString();
strConfirmedByClient = readJobs.GetInt32(5).ToString();
strActualCost = readJobs.GetInt32(6).ToString();
strMonitoring = readJobs.GetInt32(7).ToString();
strDolOrRub = readJobs.GetInt32(8).ToString();
strInvoiceToDate = readJobs.GetString(9);
strPaymentFClient = readJobs.GetString(10);
strPaymentTPartner = readJobs.GetString(11);
strJobDateB = readJobs.GetString(12);
strJobDateE = readJobs.GetString(13);
strTotalSpots = readJobs.GetInt32(14).ToString();
strGRP = readJobs.GetString(15);
strGRP30 = readJobs.GetString(16);
strTargetAudience = readJobs.GetString(17);
strR1 = readJobs.GetString(18);
strR3 = readJobs.GetString(19);
strR5 = readJobs.GetString(20);
strJobType = readJobs.GetString(22);
strSubJobType = readJobs.GetString(23);
strSubSubJobType = readJobs.GetString(24);
strJobStatus = readJobs.GetInt32(25).ToString();
strManagerID = readJobs.GetString(26);
strPrinted = readJobs.GetInt32(27).ToString();
strCPPCPR = readJobs.GetInt32(28).ToString();
strCPT = readJobs.GetInt32(29).ToString();
objW.WriteLine(lblPrID.Text.ToString()+";"+strJobID+";"+strPlannedCost+";"+strConfirmedByClient+";"+strActualCost+";"+strDolOrRub+";"+strInvoiceToDate+";"+strPaymentFClient+";"+strPaymentTPartner+";"+strJobDateB+";"+strJobDateE+";"+strTotalSpots+";"+strGRP+";"+strGRP30+";"+strTargetAudience+";"+strR1+";"+strR3+";"+strR5+";"+strJDescription+";"+strJobType+";"+strSubJobType+";"+strSubSubJobType+";"+strJobStatus+";"+strManagerID+";"+strPrinted+";"+strCPPCPR+";"+strCPT+";");
}
readJobs.Close();
sqlConnection.Close();
objW.Close();
But thank you very much anyway!
best regards,
Alex