Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
C#
try
        {
            string strXml = String.Empty;
            //DataTable _dtFinalCh = new DataTable();
            DataTable _dtFinal = new DataTable();

            _dtFinal = (DataTable)ViewState["dtExcelSheetName"];
           // DataTable _dtfinaldata = _dtFinal.AsEnumerable().Distinct().CopyToDataTable();
            if (_dtFinal != null && _dtFinal.Rows.Count > 0)
            {
                DataSet ds = new DataSet();
                ds.DataSetName = "DWR";
                ds.Tables.Add(_dtFinal);
                ds.Tables[0].TableName = "Insertxml";
                strXml = ds.GetXml();
            }
           
            GridView1.DataSource = dtExcelSheetName;
            GridView1.DataBind();
        }
        catch { }
 
     }
Posted
Updated 22-Nov-13 7:10am
v2
Comments
ZurdoDev 22-Nov-13 12:53pm    
Would you like to ask a question?
Nelek 22-Nov-13 13:12pm    
Please don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you. Just posting a bunch of code without any other text is probably not going to give you the desired result
Karthik_Mahalingam 22-Nov-13 13:46pm    
Please text something. to make us understand your issue

1 solution

it is very easy

Simple Excel 2007 Data Loader to SQL 2008 Server[^]

try this link
 
Share this answer
 

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