c# and database

Helo, I got some problems with my application.
I am trieing to make a simple adressbok. Only
one table placed on SQL server and I use SqlConnection
to connect it. It works fine. Problem I have is to implement
some commands on my table. For example INSERT command.

Do I need DataAdapter for this tas and do I need DataSet.
In that case how do I do it...

Thansk

Comments

  • : Helo, I got some problems with my application.
    : I am trieing to make a simple adressbok. Only
    : one table placed on SQL server and I use SqlConnection
    : to connect it. It works fine. Problem I have is to implement
    : some commands on my table. For example INSERT command.
    :
    : Do I need DataAdapter for this tas and do I need DataSet.
    : In that case how do I do it...
    :
    : Thansk
    :

    This is really a question about how your patterns hsould look like.

    You could add a row in a dataset, use sqlCommandBuilder to create appropiate commands, and then use the adapter to send the data to the database.

    However I would suggest using a sqlCommand object instead and use the method ExecuteNonQuery.

    --
    Patrik Lwendahl
    cshrp.net - "Elegant code by witty programmers"

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion