Click here to Skip to main content
16,006,768 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to set timeout for SQL server check access rights ? Pin
RichardGrimmer16-Jun-04 4:08
RichardGrimmer16-Jun-04 4:08 
GeneralRe: How to set timeout for SQL server check access rights ? Pin
vgrigor116-Jun-04 5:02
vgrigor116-Jun-04 5:02 
GeneralGetting table structure out of MS-Access Pin
Member 64506715-Jun-04 19:39
Member 64506715-Jun-04 19:39 
GeneralRe: Getting table structure out of MS-Access Pin
RichardGrimmer15-Jun-04 22:21
RichardGrimmer15-Jun-04 22:21 
GeneralReturning a unique value Pin
Vicetta15-Jun-04 4:00
Vicetta15-Jun-04 4:00 
GeneralRe: Returning a unique value Pin
Mike Ellison15-Jun-04 14:18
Mike Ellison15-Jun-04 14:18 
GeneralRe: Returning a unique value Pin
Vicetta15-Jun-04 22:41
Vicetta15-Jun-04 22:41 
GeneralInserting & Updating A Row With Unique Key Pin
sanjaysagrawal15-Jun-04 2:45
sanjaysagrawal15-Jun-04 2:45 
Hi all,

I have a table with one column set as primary key, which
is not supposed to be duplicated. This key has a corresponding textbox on the form which the user enters manually.

I use .ExecuteNonQuery() after setting up the parameters of a SQLCommand object to insert a row. The SP does a simple insert routine.

Using one single button for updating the table (new row/existing row), is there a simple / automatic method to modify an existing row in the table (using Triggers, etc.) ? Or, do I have to write the code in the button that will -

first, fire an sp that returns back a boolean indicating whether a row with the user-entered primary key already exists, then

second, conditionally set the .commandtext value to either of the two SPs (INSERTSP / UPDATESP) depending on whether the boolean was row-exists/does-not-exist.

finally, fire the .executenonquery() ?

Any help will be highly appreciated.

Thanks in advance,
Sanjay.

GeneralRe: Inserting & Updating A Row With Unique Key Pin
VenkatFor.NET15-Jun-04 5:14
VenkatFor.NET15-Jun-04 5:14 
GeneralRe: Inserting & Updating A Row With Unique Key Pin
nbhairav12315-Jun-04 5:19
nbhairav12315-Jun-04 5:19 
GeneralRe: Inserting & Updating A Row With Unique Key Pin
Anonymous21-Jun-04 12:56
Anonymous21-Jun-04 12:56 
GeneralRe: Inserting & Updating A Row With Unique Key Pin
Antonius_r321-Jun-04 12:57
Antonius_r321-Jun-04 12:57 
GeneralRe: Inserting & Updating A Row With Unique Key Pin
VenkatFor.NET21-Jun-04 17:46
VenkatFor.NET21-Jun-04 17:46 
GeneralRe: Inserting & Updating A Row With Unique Key Pin
Steven Campbell15-Jun-04 16:03
Steven Campbell15-Jun-04 16:03 
GeneralRe: Inserting & Updating A Row With Unique Key Pin
nbhairav12316-Jun-04 4:36
nbhairav12316-Jun-04 4:36 
QuestionMultiple definitions of SqlConnection??? Pin
matthias s.15-Jun-04 2:13
matthias s.15-Jun-04 2:13 
GeneralSqlExceltion.Number not what I expected Pin
Colin Angus Mackay15-Jun-04 0:28
Colin Angus Mackay15-Jun-04 0:28 
GeneralRe: SqlExceltion.Number not what I expected Pin
Steven Campbell15-Jun-04 15:55
Steven Campbell15-Jun-04 15:55 
GeneralRe: SqlExceltion.Number not what I expected Pin
Colin Angus Mackay15-Jun-04 20:35
Colin Angus Mackay15-Jun-04 20:35 
QuestionGetting data from MySQL db in ASP.NET? Pin
anderslundsgard15-Jun-04 0:13
anderslundsgard15-Jun-04 0:13 
AnswerRe: Getting data from MySQL db in ASP.NET? Pin
Colin Angus Mackay15-Jun-04 0:20
Colin Angus Mackay15-Jun-04 0:20 
Questionhow i can add two diffrent time Pin
syed saba14-Jun-04 22:10
syed saba14-Jun-04 22:10 
AnswerRe: how i can add two diffrent time Pin
Steven Campbell15-Jun-04 15:48
Steven Campbell15-Jun-04 15:48 
GeneralRe: how i can add two diffrent time Pin
syed saba15-Jun-04 19:07
syed saba15-Jun-04 19:07 
GeneralCreate report based on sql string Pin
Mekong River14-Jun-04 5:37
Mekong River14-Jun-04 5:37 

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.