Click here to Skip to main content
15,917,538 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Security for your apps Pin
Mark Cabbage15-Sep-07 4:49
Mark Cabbage15-Sep-07 4:49 
AnswerRe: SQL Security for your apps Pin
Mike Dimmick16-Sep-07 6:37
Mike Dimmick16-Sep-07 6:37 
GeneralRe: SQL Security for your apps Pin
Mark Cabbage16-Sep-07 15:24
Mark Cabbage16-Sep-07 15:24 
QuestionProblem with populating the FullText search Catalog Pin
Splunk14-Sep-07 7:47
Splunk14-Sep-07 7:47 
AnswerRe: Problem with populating the FullText search Catalog Pin
DerekFL14-Sep-07 7:58
DerekFL14-Sep-07 7:58 
QuestionNew rows that are added don't increment the PK field Pin
steve_rm14-Sep-07 3:17
steve_rm14-Sep-07 3:17 
AnswerRe: New rows that are added don't increment the PK field Pin
Michael Potter14-Sep-07 4:08
Michael Potter14-Sep-07 4:08 
QuestionRe: New rows that are added don't increment the PK field Pin
steve_rm14-Sep-07 7:52
steve_rm14-Sep-07 7:52 
Hello,

Thanks for the reply.

I think you may have shined some light on the problem.

I read in the xml files and create a new dataset and set the autoIncrement properties. So each time a user wants to add a new row it will do the same thing again. So I will be setting the autoIncrement properties each time.

The add form opens as a showDialog each time a user wants to add a new row. Is it possible to have a global dataset where it can be set only once?

However, there is still a problem I noticed if you look at the code snippet below, I set the autoIncrement once, then add 3 rows. But row 1 always gives a NULL for the incidentID PK.

example, why am I always getting a null for the first row?
Row 1 NULL
row 2 0
row 3 -1
etc.

<br />
Dim dr As DataRow<br />
'Set the auto increment columns<br />
dsIncidents.Tables(0).Columns("IncidentID").AutoIncrementSeed = 0<br />
dsIncidents.Tables(0).Columns("IncidentID").AutoIncrementStep = -1<br />
dsIncidents.Tables(0).Columns("IncidentID").AutoIncrement = True<br />
<br />
dr = dsIncidents.Tables(0).NewRow()<br />
dr("Company") = Me.cboCustomer.Text<br />
dr("Contact") = Me.cboContact.Text<br />
dr("PhoneNo") = Me.txtPhone.Text<br />
dr("Priority") = Me.cboPrority.Text<br />
dr("Subject") = Me.txtSubject.Text<br />
dr("AssignedTo") = Me.cboUsers.Text<br />
dsIncidents.Tables(0).Rows.Add(dr) 'Add the new row 1<br />
<br />
dr = dsIncidents.Tables(0).NewRow()<br />
dr("Company") = Me.cboCustomer.Text<br />
dr("Contact") = Me.cboContact.Text<br />
dr("PhoneNo") = Me.txtPhone.Text<br />
dr("Priority") = Me.cboPrority.Text<br />
dr("Subject") = Me.txtSubject.Text<br />
dr("AssignedTo") = Me.cboUsers.Text<br />
dsIncidents.Tables(0).Rows.Add(dr) 'Add the new row 2<br />
<br />
dr = dsIncidents.Tables(0).NewRow()<br />
dr("Company") = Me.cboCustomer.Text<br />
dr("Contact") = Me.cboContact.Text<br />
dr("PhoneNo") = Me.txtPhone.Text<br />
dr("Priority") = Me.cboPrority.Text<br />
dr("Subject") = Me.txtSubject.Text<br />
dr("AssignedTo") = Me.cboUsers.Text<br />
dsIncidents.Tables(0).Rows.Add(dr) 'Add the new row 3<br />


Many thanks for any extra help with this problem.

Steve
AnswerRe: New rows that are added don't increment the PK field Pin
Michael Potter14-Sep-07 8:33
Michael Potter14-Sep-07 8:33 
QuestionRe: New rows that are added don't increment the PK field Pin
steve_rm14-Sep-07 19:01
steve_rm14-Sep-07 19:01 
QuestionRe: New rows that are added don't increment the PK field Pin
steve_rm16-Sep-07 0:33
steve_rm16-Sep-07 0:33 
GeneralRequesting for a link for web services basics... Pin
Sushil D Jadhav14-Sep-07 0:26
Sushil D Jadhav14-Sep-07 0:26 
GeneralRe: Requesting for a link for web services basics... Pin
Pete O'Hanlon14-Sep-07 1:41
mvePete O'Hanlon14-Sep-07 1:41 
QuestionADO.NET free E-books Pin
Vimalsoft(Pty) Ltd14-Sep-07 0:04
professionalVimalsoft(Pty) Ltd14-Sep-07 0:04 
AnswerRe: ADO.NET free E-books Pin
Pete O'Hanlon14-Sep-07 3:46
mvePete O'Hanlon14-Sep-07 3:46 
GeneralRe: ADO.NET free E-books Pin
Vimalsoft(Pty) Ltd14-Sep-07 4:21
professionalVimalsoft(Pty) Ltd14-Sep-07 4:21 
QuestionJoin and Nested Query Pin
.NET- India 13-Sep-07 23:01
.NET- India 13-Sep-07 23:01 
AnswerRe: Join and Nested Query Pin
Colin Angus Mackay14-Sep-07 0:10
Colin Angus Mackay14-Sep-07 0:10 
AnswerRe: Join and Nested Query Pin
DLM@TD14-Sep-07 11:01
DLM@TD14-Sep-07 11:01 
Questionarray in a asp Pin
nicetohaveyou13-Sep-07 21:07
nicetohaveyou13-Sep-07 21:07 
AnswerRe: array in a asp Pin
Joe13-Sep-07 21:57
Joe13-Sep-07 21:57 
GeneralRe: array in a sp Pin
nicetohaveyou13-Sep-07 22:30
nicetohaveyou13-Sep-07 22:30 
GeneralRe: array in a sp Pin
Pete O'Hanlon13-Sep-07 22:44
mvePete O'Hanlon13-Sep-07 22:44 
QuestionSql Reporting Services viewer refresh problem Pin
Phanindra Kumar13-Sep-07 20:24
Phanindra Kumar13-Sep-07 20:24 
AnswerRe: Sql Reporting Services viewer refresh problem Pin
DerekFL14-Sep-07 9:08
DerekFL14-Sep-07 9:08 

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.