Click here to Skip to main content
15,899,935 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to hold reference of dll when page refreshes Pin
SimulationofSai10-May-07 3:50
SimulationofSai10-May-07 3:50 
QuestionAsp.net 2.0 + c# Pin
ritu432110-May-07 0:58
ritu432110-May-07 0:58 
AnswerRe: Asp.net 2.0 + c# Pin
Spunky Coder10-May-07 1:20
Spunky Coder10-May-07 1:20 
GeneralRe: Asp.net 2.0 + c# [modified] Pin
ritu432110-May-07 1:39
ritu432110-May-07 1:39 
GeneralRe: Asp.net 2.0 + c# Pin
SimulationofSai10-May-07 2:13
SimulationofSai10-May-07 2:13 
GeneralRe: Asp.net 2.0 + c# Pin
ritu432110-May-07 2:19
ritu432110-May-07 2:19 
GeneralRe: Asp.net 2.0 + c# Pin
Spunky Coder10-May-07 2:39
Spunky Coder10-May-07 2:39 
QuestionError in reading excel datas Pin
vijay_8310-May-07 0:56
vijay_8310-May-07 0:56 
hi,

In a button click, i have to read datas from excel sheet and store it in mysql database table. This is my code for that

private void Button1_Click(object sender, System.EventArgs e)
{

try
{
string strConnection =("Driver={Microsoft Excel Driver (*.xls)};DriverId=790;bq=C:\\Salary.xls;DefaultDir=c:\\;");
OdbcConnection conn = new OdbcConnection(strConnection);
//conn.Open();
OdbcCommand command = new OdbcCommand("SELECT * FROM [Sheet1$]",conn);
// command.Connection = conn;
// command.CommandType = CommandType.Text;
// command.CommandText = "SELECT * FROM [Sheet1]";
OdbcDataAdapter da = new OdbcDataAdapter(command);
DataTable dt= new DataTable();
conn.Open();
da.Fill(dt);
conn.Close();

//return dt;
}
catch (Exception ex)
{
lblError.Text = ex.Message;
//return null;


}
}

I get an error like this.

ERROR [42S02] [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.

I have specified my path name correctly in the connection string and my sheet name is Sheet1. but i don't know why i get this error. Anybody pls help.

Regards
Vijay.Smile | :)
AnswerRe: Error in reading excel datas Pin
Sylvester george10-May-07 1:58
Sylvester george10-May-07 1:58 
AnswerRe: Error in reading excel datas Pin
Spunky Coder10-May-07 2:10
Spunky Coder10-May-07 2:10 
GeneralRe: Error in reading excel datas Pin
vijay_8312-May-07 2:01
vijay_8312-May-07 2:01 
QuestionIs CSS only for HTML Controls Pin
Bajrang Singh10-May-07 0:32
Bajrang Singh10-May-07 0:32 
AnswerRe: Is CSS only for HTML Controls Pin
wEb GuRu...10-May-07 0:41
wEb GuRu...10-May-07 0:41 
GeneralRe: Is CSS only for HTML Controls [modified] Pin
Bajrang Singh10-May-07 1:49
Bajrang Singh10-May-07 1:49 
Questiongetting font from a specific location other than windows font folder in ASP.Net Pin
Mudasser Hassan10-May-07 0:10
Mudasser Hassan10-May-07 0:10 
AnswerRe: getting font from a specific location other than windows font folder in ASP.Net Pin
Mudasser Hassan13-May-07 21:13
Mudasser Hassan13-May-07 21:13 
QuestionServer error Pin
n_gchaitra9-May-07 23:41
n_gchaitra9-May-07 23:41 
AnswerRe: Server error Pin
wEb GuRu...9-May-07 23:56
wEb GuRu...9-May-07 23:56 
GeneralRe: Server error Pin
n_gchaitra15-May-07 18:58
n_gchaitra15-May-07 18:58 
AnswerRe: Server error Pin
SimulationofSai9-May-07 23:56
SimulationofSai9-May-07 23:56 
AnswerRe: Server error Pin
Venkatesh Mookkan10-May-07 0:03
Venkatesh Mookkan10-May-07 0:03 
GeneralRe: Server error Pin
n_gchaitra15-May-07 18:54
n_gchaitra15-May-07 18:54 
GeneralRe: Server error Pin
n_gchaitra15-May-07 18:56
n_gchaitra15-May-07 18:56 
GeneralRe: Server error Pin
n_gchaitra15-May-07 18:59
n_gchaitra15-May-07 18:59 
GeneralRe: Server error Pin
Venkatesh Mookkan15-May-07 21:43
Venkatesh Mookkan15-May-07 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.