coding @ the speed of thought RSS 2.0
 Sunday, December 30, 2007

using i bilirsiniz.
using System.Data;
using System.Configuration;
....

bir de böyle deneyin ;

public
void InsertRow(string connectionString, string insertSQL)
{
    using (OleDbConnection connection = new OleDbConnection(connectionString))
    {
        // The insertSQL string contains a SQL statement that
        // inserts a new row in the source table.
        OleDbCommand command = new OleDbCommand(insertSQL);

        // Set the Connection to the new OleDbConnection.
        command.Connection = connection;

        // Open the connection and execute the insert command.
        try
        {
            connection.Open();
            command.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        // The connection is automatically closed when the
        // code exits the using block.
    }
}

Kullanım sonunda belirttiği gibi imleç using bloğundan çıktığı anda bağlantı kapatılacaktır.Bu özelliği bana hatırlatan Emre arkadaşıma teşekkürü bir borç bilirim.

Sunday, December 30, 2007 9:23:54 PM (GTB Standard Time, UTC+02:00)  #    Comments [0] -
Software
Archive
<December 2007>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Levent YILDIZ
Sign In
Statistics
Total Posts: 99
This Year: 31
This Month: 10
This Week: 2
Comments: 28
Themes
Pick a theme:
All Content © 2008, Levent YILDIZ
DasBlog theme 'Business' created by Christoph De Baene (delarou)