*Use this Coding:*
public String[] GetExcelSheetColums(string filename){

OleDbConnection objConn = null;
System.Data.DataTable dt = null;

try
{

String cxString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";Extended Properties=Excel 8.0;";

objCx = new OleDbConnection(cxString);

objCx.Open();

String[] restrection = {null,null,"Sheet1$",null}

dt = objCx.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, restrection);

if(dt == null)
{
return null;
}

String[] excelSheets = new String[dt.Rows.Count];
int i = 0;


foreach(DataRow row in dt.Rows)
{
excelSheets[i] = row["COLUMN_NAME"].ToString();
i++;
}


for(int j=0; j < excelSheets.Length; j++)
{

// you the column name to deal with your database!!!!
}

return excelSheets;
}
catch(Exception ex)
{
return null;
}
finally
{
if(objConn != null)
{
objConn.Close();
objConn.Dispose();
}
if(dt != null)
{
dt.Dispose();
}
}
}


On Tue, Feb 3, 2009 at 2:44 PM, vanitha palanisamy <[email protected]>wrote:

> Hi Folks,
>
> Do anyone knew how to convert excel to .dbf(FoxPro DataBase) in 
> ASP.NET<http://asp.net/>using C#.
>
> If so plz let me know
>
> Thankz in advance
>



-- 
 With Love & Regards,
                                  (\__/)
                                  (='.'=)
                                  (")_(")
                                  Dinesh.P

Reply via email to