|
I tried to created in c# code to export my storeprocedure in excel SqlConnection cn = new SqlConnection(strConn); cn.Open(); SqlCommand cmd = new SqlCommand("StoreprocedureName", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@date",date); SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.KeyInfo); i don't know how i export excel.. i have use datatable to export in excel cn.close();
(comments are locked)
|
|
I not too sure about C#, but here is the VBA route that I have used before. I did google it and I sumbled on this article. As a non-programmer I normally used the TSQL/OPENROWSET
(comments are locked)
|


Are you trying to execute a SP within excel to then populate the cells?
I need c# but if you vb.net is ok i will converted to c#
I deleted that comment, can you review my response above?
Yes i am tried to execute store procedure and created and export in excel.