Click here to Skip to main content
15,915,694 members
Home / Discussions / Database
   

Database

 
GeneralRe: It gives me an error message - Login Fails. Pin
Anonymous5-Jun-03 13:42
Anonymous5-Jun-03 13:42 
QuestionSQL server experts??? Pin
abc8764-Jun-03 9:26
abc8764-Jun-03 9:26 
AnswerRe: SQL server experts??? Pin
Anonymous4-Jun-03 13:56
Anonymous4-Jun-03 13:56 
GeneralThere Must Be A Better Way (ADO) Pin
Roger Wright4-Jun-03 4:28
professionalRoger Wright4-Jun-03 4:28 
GeneralRe: There Must Be A Better Way (ADO) Pin
Jason McBurney4-Jun-03 4:45
Jason McBurney4-Jun-03 4:45 
GeneralRe: There Must Be A Better Way (ADO) Pin
Roger Wright4-Jun-03 4:54
professionalRoger Wright4-Jun-03 4:54 
Generalauto increment MySQL versus dataset Pin
kenhall3-Jun-03 9:46
kenhall3-Jun-03 9:46 
GeneralDataTable Constraints not working... Pin
kenhall3-Jun-03 7:23
kenhall3-Jun-03 7:23 
I am having trouble getting table constraints to work the way I think they should. I have unique constraints set up for two fields of a three field table, and when I add a row to the table, I was hoping the constraints would be honored at that time. I want the new row to have unique values in the fields for the entire column in the table. Here is what I am setting up:

private OdbcDataAdapter keyvalueDA;
.
.
.
keyvalueDA = new OdbcDataAdapter
("SELECT value_id, value, valuehash FROM keyvalue", conn);
keyvalueDACmdBuilder = new OdbcCommandBuilder(keyvalueDA);
keyvalueDA.FillSchema(ds, SchemaType.Source, "keyvalue" );
.
.
keyvalueDA.Fill(ds, "keyvalue");
.
.
.
// Now in a method, I insert the new values in the table.
DataTable myTable = ds.Tables[tableName];
myDataRow = myTable.NewRow();
myDataRow["value"] = valuepassedin1;
myDataRow["valuehash"] = valuepassedin2;
// and then call
myTable.Rows.Add(myDataRow);

At this point I would expect since valuehash is set to be unique, that if I tried to enter a duplicate, it would complain here.
It does not.
I get no indication of a problem until I try to update the dataset into the real database

keyvalueDA.Update(ds, "keyvalue");

which then throws an exception, duplicate key entry.

When I look at the dataset, it shows that the unique constraints are being enforced
in dataset:
enforceConstraints true bool

Do I need to explicitly set the constraints for the "new row" before I add it to the table?

GeneralRe: DataTable Constraints not working... Pin
kenhall4-Jun-03 7:27
kenhall4-Jun-03 7:27 
GeneralTemp table and data adapter problem Pin
Mike Osbahr3-Jun-03 4:26
Mike Osbahr3-Jun-03 4:26 
GeneralSQLBindParameter not used for all parameters Pin
kenhall2-Jun-03 10:19
kenhall2-Jun-03 10:19 
Generalbizaare sql server 7 + ado/asp error Pin
Nathan Ridley2-Jun-03 1:56
Nathan Ridley2-Jun-03 1:56 
GeneralRe: bizaare sql server 7 + ado/asp error Pin
basementman2-Jun-03 9:29
basementman2-Jun-03 9:29 
GeneralRe: bizaare sql server 7 + ado/asp error Pin
Nathan Ridley2-Jun-03 14:14
Nathan Ridley2-Jun-03 14:14 
GeneralDataset Table.Select strExpr problem Pin
kenhall31-May-03 23:56
kenhall31-May-03 23:56 
GeneralRe: Dataset Table.Select strExpr problem Pin
andyharman1-Jun-03 0:58
professionalandyharman1-Jun-03 0:58 
GeneralRe: Dataset Table.Select strExpr problem Pin
kenhall2-Jun-03 10:13
kenhall2-Jun-03 10:13 
GeneralADOX Creating table fileds, which allow Zero length Pin
Mayank Goyal31-May-03 3:37
Mayank Goyal31-May-03 3:37 
GeneralBatch update from XML Pin
Hesham Amin30-May-03 8:25
Hesham Amin30-May-03 8:25 
GeneralRe: Batch update from XML Pin
Paul Watson31-May-03 9:50
sitebuilderPaul Watson31-May-03 9:50 
GeneralRe: Batch update from XML Pin
Hesham Amin31-May-03 11:23
Hesham Amin31-May-03 11:23 
GeneralDB engines for software local/file DB (no server running) Pin
Jean-Marc Molina29-May-03 14:12
Jean-Marc Molina29-May-03 14:12 
GeneralRe: DB engines for software local/file DB (no server running) Pin
andyharman30-May-03 3:19
professionalandyharman30-May-03 3:19 
GeneralRe: DB engines for software local/file DB (no server running) Pin
Jean-Marc Molina31-May-03 9:40
Jean-Marc Molina31-May-03 9:40 
GeneralRe: DB engines for software local/file DB (no server running) Pin
andyharman1-Jun-03 0:49
professionalandyharman1-Jun-03 0:49 

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.