Click here to Skip to main content
15,905,914 members
Home / Discussions / C#
   

C#

 
Questionframework 1.1 - 2.0 compatibility issue Pin
Rick van Woudenberg28-Aug-07 21:46
Rick van Woudenberg28-Aug-07 21:46 
QuestionRe: framework 1.1 - 2.0 compatibility issue Pin
Vikram A Punathambekar28-Aug-07 22:15
Vikram A Punathambekar28-Aug-07 22:15 
AnswerRe: framework 1.1 - 2.0 compatibility issue Pin
Rick van Woudenberg28-Aug-07 22:45
Rick van Woudenberg28-Aug-07 22:45 
QuestionFile Uploader Pin
minniemooo28-Aug-07 21:38
minniemooo28-Aug-07 21:38 
AnswerRe: File Uploader Pin
Vikram A Punathambekar28-Aug-07 22:18
Vikram A Punathambekar28-Aug-07 22:18 
GeneralRe: File Uploader Pin
Vasudevan Deepak Kumar29-Aug-07 1:29
Vasudevan Deepak Kumar29-Aug-07 1:29 
Questiondata type mismatch error Pin
csanda128-Aug-07 21:23
csanda128-Aug-07 21:23 
AnswerRe: data type mismatch error Pin
Rick van Woudenberg28-Aug-07 22:00
Rick van Woudenberg28-Aug-07 22:00 
Hi csanda,

You're trying to assign an insert statement as the value for integer t1, while an insert statement should be executed by itself and an integer can only have numbers as a value. I would do it differently. Try the following code :

void Whatever()<br />
{<br />
try<br />
{<br />
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=datacapt.mdb";<br />
OleDbConnection conn = new OleDbConnection(strConnection);<br />
conn.Open();<br />
string strCommand = "INSERT INTO compdata(ID,CompanyName,ContactName) Values ('" + txID.Text + "','" + txtName.Text + "','" + txtcontact.Text + "')";<br />
<br />
OleDbDataAdapter adapter = new OleDbDataAdapter();<br />
adapter.InsertCommand = new OleDbCommand(strCommand, conn);<br />
<br />
<br />
adapter.InsertCommand.ExecuteNonQuery(); <br />
conn.Close();<br />
<br />
{<br />
MessageBox.Show("Added successfully!");<br />
}<br />
}<br />
catch (Exception exc)<br />
{<br />
MessageBox.Show("An error occured :" + exc.ToString());<br />
}<br />
}


cheers,
GeneralRe: data type mismatch error Pin
csanda129-Aug-07 0:09
csanda129-Aug-07 0:09 
AnswerRe: data type mismatch error Pin
J4amieC28-Aug-07 22:18
J4amieC28-Aug-07 22:18 
AnswerRe: data type mismatch error Pin
PIEBALDconsult29-Aug-07 4:11
mvePIEBALDconsult29-Aug-07 4:11 
QuestionHow to make a dialog box modal? [modified] Pin
TaiZhong28-Aug-07 21:18
TaiZhong28-Aug-07 21:18 
AnswerRe: How to make a dialog box modal? Pin
Bekjong28-Aug-07 22:58
Bekjong28-Aug-07 22:58 
QuestionRegasm Registration Problem Pin
swamy Narasimha28-Aug-07 21:07
swamy Narasimha28-Aug-07 21:07 
QuestionParsing Text file Data Pin
MussaratAziz28-Aug-07 20:32
MussaratAziz28-Aug-07 20:32 
AnswerRe: Parsing Text file Data Pin
Christian Graus28-Aug-07 20:45
protectorChristian Graus28-Aug-07 20:45 
AnswerRe: Parsing Text file Data Pin
J4amieC28-Aug-07 22:11
J4amieC28-Aug-07 22:11 
GeneralRe: Parsing Text file Data Pin
ChandraRam28-Aug-07 23:50
ChandraRam28-Aug-07 23:50 
GeneralRe: Parsing Text file Data Pin
J4amieC29-Aug-07 0:32
J4amieC29-Aug-07 0:32 
Questiondouble click on ListBox items Pin
Maddie from Dartford28-Aug-07 20:25
Maddie from Dartford28-Aug-07 20:25 
AnswerRe: double click on ListBox items Pin
Martin#28-Aug-07 21:33
Martin#28-Aug-07 21:33 
GeneralRe: double click on ListBox items Pin
Maddie from Dartford29-Aug-07 2:04
Maddie from Dartford29-Aug-07 2:04 
GeneralRe: double click on ListBox items Pin
Martin#29-Aug-07 2:11
Martin#29-Aug-07 2:11 
Questionreports in c# Pin
Sonia Gupta28-Aug-07 20:13
Sonia Gupta28-Aug-07 20:13 
QuestionRendering movie in Desktop background Pin
Anindya Chatterjee28-Aug-07 19:54
Anindya Chatterjee28-Aug-07 19:54 

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.