Click here to Skip to main content
15,922,650 members
Home / Discussions / C#
   

C#

 
AnswerRe: Perfect Timing! Pin
Christian Graus29-Aug-07 2:05
protectorChristian Graus29-Aug-07 2:05 
GeneralRe: Perfect Timing! Pin
pokabot29-Aug-07 3:00
pokabot29-Aug-07 3:00 
AnswerRe: Perfect Timing! Pin
Hessam Jalali29-Aug-07 5:08
Hessam Jalali29-Aug-07 5:08 
QuestionsaveFileDialog Pin
lourensG29-Aug-07 0:28
lourensG29-Aug-07 0:28 
AnswerRe: saveFileDialog Pin
blackjack215029-Aug-07 0:39
blackjack215029-Aug-07 0:39 
GeneralRe: saveFileDialog Pin
lourensG29-Aug-07 0:46
lourensG29-Aug-07 0:46 
GeneralRe: saveFileDialog Pin
Vikram A Punathambekar29-Aug-07 0:58
Vikram A Punathambekar29-Aug-07 0:58 
GeneralRe: saveFileDialog Pin
blackjack215029-Aug-07 1:59
blackjack215029-Aug-07 1:59 
QuestionHow to get the specified process Pin
Situ1429-Aug-07 0:09
Situ1429-Aug-07 0:09 
AnswerRe: How to get the specified process Pin
Martin#29-Aug-07 0:18
Martin#29-Aug-07 0:18 
AnswerRe: How to get the specified process Pin
Luc Pattyn29-Aug-07 2:10
sitebuilderLuc Pattyn29-Aug-07 2:10 
Questionpic in crystal reports Pin
Sonia Gupta28-Aug-07 23:13
Sonia Gupta28-Aug-07 23:13 
AnswerRe: pic in crystal reports Pin
Rupesh Kumar Swami28-Aug-07 23:39
Rupesh Kumar Swami28-Aug-07 23:39 
GeneralRe: pic in crystal reports Pin
Sonia Gupta28-Aug-07 23:54
Sonia Gupta28-Aug-07 23:54 
GeneralRe: pic in crystal reports Pin
Rupesh Kumar Swami29-Aug-07 0:05
Rupesh Kumar Swami29-Aug-07 0:05 
GeneralRe: pic in crystal reports Pin
Sonia Gupta29-Aug-07 0:42
Sonia Gupta29-Aug-07 0:42 
GeneralRe: pic in crystal reports Pin
Rupesh Kumar Swami29-Aug-07 0:53
Rupesh Kumar Swami29-Aug-07 0:53 
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,

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.