Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
AnswerRe: thread closing connection Pin
Luc Pattyn30-Sep-07 4:06
sitebuilderLuc Pattyn30-Sep-07 4:06 
QuestionImage Preocessing Application - help required Pin
sunny7429-Sep-07 23:18
sunny7429-Sep-07 23:18 
AnswerRe: Image Preocessing Application - help required Pin
Paul Conrad30-Sep-07 13:10
professionalPaul Conrad30-Sep-07 13:10 
QuestionRe: Image Preocessing Application - help required Pin
sunny7430-Sep-07 20:04
sunny7430-Sep-07 20:04 
QuestionFlash animations in Visual Studio C# .Net Pin
zeeShan anSari29-Sep-07 22:34
zeeShan anSari29-Sep-07 22:34 
AnswerRe: Flash animations in Visual Studio C# .Net Pin
Christian Graus29-Sep-07 23:12
protectorChristian Graus29-Sep-07 23:12 
QuestionADO.NET and C# Pin
sean0029-Sep-07 18:51
sean0029-Sep-07 18:51 
AnswerRe: ADO.NET and C# Pin
ESTAN30-Sep-07 0:44
ESTAN30-Sep-07 0:44 
<br />
sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\DB.mdb;";<br />



INSERT, UPDATE, DELETE DATA

sQuery is the SQL string

<br />
// Create the connection<br />
OleDbConnection oleDbConn = new OleDbConnection(sConnString);<br />
            <br />
// Create the command object and store the sql query<br />
OleDbCommand oleDbCmd = new OleDbCommand(sQuery, oleDbConn);<br />
            <br />
// Open the connection<br />
oleDbConn.Open();<br />
            <br />
oleDbCmd.ExecuteNonQuery();<br />
            <br />
// Close the connection<br />
oleDbConn.Close();<br />


SELECT DATA

<br />
// Create the connection<br />
OleDbConnection oleDbConn = new OleDbConnection(sConnString);<br />
<br />
// Create the command object and store the sql query<br />
OleDbCommand oleDbCmd = new OleDbCommand(sQuery, oleDbConn);<br />
<br />
// Open the connection<br />
oleDbConn.Open();<br />
<br />
OleDbDataReader oleDbRd = oleDbCmd.ExecuteReader();<br />
<br />
while (oleDbRd.Read())<br />
{<br />
	textbox1.Text = oleDbRd.GetValue(0);<br />
}<br />
<br />
// Close the connection<br />
oleDbConn.Close();<br />
<br />

QuestionDeseralize an array of objects Pin
eggie529-Sep-07 16:28
eggie529-Sep-07 16:28 
AnswerRe: Deseralize an array of objects [modified] Pin
TJoe1-Oct-07 3:41
TJoe1-Oct-07 3:41 
QuestionSimple Inheritance Pin
eggie529-Sep-07 14:07
eggie529-Sep-07 14:07 
AnswerRe: Simple Inheritance Pin
Christian Graus29-Sep-07 14:19
protectorChristian Graus29-Sep-07 14:19 
AnswerRe: Simple Inheritance Pin
Guffa29-Sep-07 14:25
Guffa29-Sep-07 14:25 
GeneralRe: Simple Inheritance Pin
eggie529-Sep-07 14:31
eggie529-Sep-07 14:31 
AnswerRe: Simple Inheritance Pin
PIEBALDconsult29-Sep-07 14:46
mvePIEBALDconsult29-Sep-07 14:46 
QuestionHow to call from another class? Pin
MasterSharp29-Sep-07 13:32
MasterSharp29-Sep-07 13:32 
AnswerRe: How to call from another class? Pin
Guffa29-Sep-07 13:45
Guffa29-Sep-07 13:45 
Answer[Message Deleted] Pin
DotNetXenon29-Sep-07 13:55
DotNetXenon29-Sep-07 13:55 
GeneralRe: How to call from another class? Pin
Christian Graus29-Sep-07 14:18
protectorChristian Graus29-Sep-07 14:18 
AnswerRe: How to call from another class? Pin
Dave Kreskowiak29-Sep-07 19:57
mveDave Kreskowiak29-Sep-07 19:57 
GeneralRe: How to call from another class? Pin
MasterSharp30-Sep-07 3:33
MasterSharp30-Sep-07 3:33 
GeneralRe: How to call from another class? Pin
Dave Kreskowiak30-Sep-07 3:53
mveDave Kreskowiak30-Sep-07 3:53 
GeneralRe: How to call from another class? Pin
MasterSharp30-Sep-07 13:25
MasterSharp30-Sep-07 13:25 
QuestionHow to draw? Pin
MasterSharp29-Sep-07 11:06
MasterSharp29-Sep-07 11:06 
AnswerRe: How to draw? Pin
Lutosław29-Sep-07 11:28
Lutosław29-Sep-07 11:28 

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.