Community discussion forum

How to execute DDL Statement in ADO.NET ?

  • 5 months ago

    I am making project using vb.net and sqlserver 2005 and for connectivity, i have used ADO.NET. In past, i used to use ADO to connect database with front end in VB6 and i used to execute any DDL statement through the 'EXECUTE method of the CONNECTION object from the front end'. But in VB.Net, i am using ADO.Net and i am running DML statement (Insert,Update,Delete,Select) through OLEDBConnection or SQLConnection object but i got problem when i tried to run DDL Statement throughm them like in previous version of ADO. So, please if any of you have ideas about it, please help me. I will be very grateful to you. Expecting good suggestion and kind help regarding this matter.

    Post was edited on 04/06/2009 15:38:04 Report abuse
  • 5 months ago

    I am making project using vb.net and sqlserver 2005 and for connectivity, i have used ADO.NET. In past, i used to use ADO to connect database with front end in VB6 and i used to execute any DDL statement through the 'EXECUTE method of the CONNECTION object from the front end'. But in VB.Net, i am using ADO.Net and i am running DML statement (Insert,Update,Delete,Select) through OLEDBConnection or SQLConnection object but i got problem when i tried to run DDL Statement throughm them like in previous version of ADO. So, please if any of you have ideas about it, please help me. I will be very grateful to you. Expecting good suggestion and kind help regarding this matter.

  • 4 months ago

    Hi shanker,

    For executing insert/update/delete statements user following way:

    Dim cmd As New SqlClient.SqlCommand cmd.Connection = your conenction object cmd.CommandText = "insert update or delete statement comes here" cmd.ExecuteNonQuery()

    Regards

  • 4 months ago

    Hi shanker,

    For executing insert/update/delete statements user following way:

    Dim cmd As New SqlClient.SqlCommand
    cmd.Connection = your conenction object
    cmd.CommandText = "insert update or delete statement comes here"
    cmd.ExecuteNonQuery()
    

    Regards

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!