Click here to Skip to main content
15,921,226 members
Home / Discussions / Database
   

Database

 
GeneralRe: Data Parameters Pin
Bill Dean24-Feb-04 17:05
Bill Dean24-Feb-04 17:05 
QuestionCan you create tables from dataset/tables? Pin
Rebur24-Feb-04 14:14
sussRebur24-Feb-04 14:14 
AnswerRe: Can you create tables from dataset/tables? Pin
Not Active24-Feb-04 15:54
mentorNot Active24-Feb-04 15:54 
AnswerRe: Can you create tables from dataset/tables? Pin
RChin25-Feb-04 7:08
RChin25-Feb-04 7:08 
GeneralSimple question that is KILLING me!!! Pin
HarleyJase24-Feb-04 9:24
HarleyJase24-Feb-04 9:24 
GeneralRe: Simple question that is KILLING me!!! Pin
Edbert P24-Feb-04 11:28
Edbert P24-Feb-04 11:28 
GeneralRe: Simple question that is KILLING me!!! Pin
HarleyJase24-Feb-04 12:09
HarleyJase24-Feb-04 12:09 
GeneralRe: Simple question that is KILLING me!!! Pin
Edbert P24-Feb-04 17:34
Edbert P24-Feb-04 17:34 
If you are using MS Visual Studio, let it build one for you (do drag-drop of the data adapter, set the connection, then set the Select, Insert, Update, and Delete Commands through the properties window). Otherwise you can use whatever code it builds as an example.

For your code above, there are some things you might want to check:

1. First, make sure that when you're adding the Command Parameters you are specifying the valid DbType. I was only giving an example with the SqlDBType.NVarChar as I don't know your table structure. I bet that CheckedOut is actually of the type DBTimeStamp instead of NVarChar. If you are unsure of this, the easiest way is to let VS build one for you, otherwise check MSDN for SqlDbType. Also make sure that non-nullable columns are filled.

2. You also have to set the connection for the command (this was done in your code, just don't forget it), i.e.
cmd.Connection = sqlConnection1;

3. Set the command to the adapter, i.e.
myAdapter.InsertCommand = cmd;

If I'm not wrong, you don't need to open/close your sqlConnection as data adapter will do it automatically (it will open and close it everytime you call the fill/update commands).

I hope it will work.

Edbert P.
Sydney, Australia.
GeneralRe: Simple question that is KILLING me!!! Pin
HarleyJase25-Feb-04 5:06
HarleyJase25-Feb-04 5:06 
GeneralRe: Simple question that is KILLING me!!! Pin
HarleyJase25-Feb-04 5:20
HarleyJase25-Feb-04 5:20 
GeneralRe: Simple question that is KILLING me!!! Pin
Edbert P25-Feb-04 11:37
Edbert P25-Feb-04 11:37 
GeneralRe: Simple question that is KILLING me!!! Pin
HarleyJase26-Feb-04 7:05
HarleyJase26-Feb-04 7:05 
GeneralRe: Simple question that is KILLING me!!! Pin
Edbert P26-Feb-04 11:01
Edbert P26-Feb-04 11:01 
GeneralSQL Server Stored Procedure Pagination Pin
Braulio Dez24-Feb-04 6:13
Braulio Dez24-Feb-04 6:13 
GeneralData type mismatch blues. Pin
Marypoppins23-Feb-04 22:39
Marypoppins23-Feb-04 22:39 
GeneralRe: Data type mismatch blues. Pin
Verdant12324-Feb-04 5:12
Verdant12324-Feb-04 5:12 
GeneralRe: Data type mismatch blues. Pin
Marypoppins24-Feb-04 18:52
Marypoppins24-Feb-04 18:52 
Generalconnect to web service Pin
arzu23-Feb-04 21:43
arzu23-Feb-04 21:43 
GeneralRe: connect to web service Pin
Verdant12324-Feb-04 5:08
Verdant12324-Feb-04 5:08 
Generalbase de donnée avec une classe en C++ Pin
MagicFans9122-Feb-04 23:24
MagicFans9122-Feb-04 23:24 
GeneralRe: base de donnée avec une classe en C++ Pin
Sarvesvara (BVKS) Dasa23-Feb-04 2:06
Sarvesvara (BVKS) Dasa23-Feb-04 2:06 
GeneralRe: base de donnée avec une classe en C++ Pin
Verdant12323-Feb-04 12:06
Verdant12323-Feb-04 12:06 
GeneralRe: base de donnée avec une classe en C++ Pin
maevava26-Apr-04 1:54
maevava26-Apr-04 1:54 
GeneralInstall my SQL Database to other Machine Pin
Sarvesvara (BVKS) Dasa22-Feb-04 20:12
Sarvesvara (BVKS) Dasa22-Feb-04 20:12 
GeneralRe: Install my SQL Database to other Machine Pin
TLWallace22-Feb-04 20:43
TLWallace22-Feb-04 20:43 

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.