Click here to Skip to main content
15,892,927 members
Home / Discussions / C#
   

C#

 
GeneralRe: Inheriting from the tabcontrol Pin
thepersonof13-Oct-06 10:48
thepersonof13-Oct-06 10:48 
QuestionFiles in folder Pin
Mohammed Elkholy7-Oct-06 2:48
Mohammed Elkholy7-Oct-06 2:48 
AnswerRe: Files in folder Pin
DownBySpj7-Oct-06 3:06
DownBySpj7-Oct-06 3:06 
QuestionRaising events in C# Pin
Mahhouraaaaaa7-Oct-06 1:44
Mahhouraaaaaa7-Oct-06 1:44 
AnswerRe: Raising events in C# Pin
Captain See Sharp7-Oct-06 4:02
Captain See Sharp7-Oct-06 4:02 
QuestionGet time Pin
mehrdadc487-Oct-06 1:39
mehrdadc487-Oct-06 1:39 
Questiongetting error code Pin
DownBySpj7-Oct-06 1:28
DownBySpj7-Oct-06 1:28 
AnswerRe: getting error code Pin
Guffa7-Oct-06 1:55
Guffa7-Oct-06 1:55 
I assume that you expect an error because the record already exists? Then do it the other way arond; first try the update and check how many records were updated. If the record didn't exist the number of records is zero, and you know that you have to make an insert instead.

If you are using MS SQL Server, you can do this in a stored procedure:

create procedure DoSomeSetting
   @SomeId int,
   @SomeValue somedatatype
as

update DaTable
set Something = @SomeValue
where SomeId = @SomeId

if @@rowcount = 0 begin

   insert into DaTable (Something)
   values (@SomeValue)

end



---
b { font-weight: normal; }

QuestionHow to Convert This Code to C# ? Pin
hdv2127-Oct-06 1:00
hdv2127-Oct-06 1:00 
AnswerRe: How to Convert This Code to C# ? Pin
Aashutoshkumar7-Oct-06 1:12
Aashutoshkumar7-Oct-06 1:12 
Questionsend mail Pin
vivek.s.vivek6-Oct-06 23:24
vivek.s.vivek6-Oct-06 23:24 
AnswerRe: send mail Pin
Rajesh_K_Sharma7-Oct-06 9:12
Rajesh_K_Sharma7-Oct-06 9:12 
QuestionFormBoardStyle Pin
ShadowRayz6-Oct-06 19:27
ShadowRayz6-Oct-06 19:27 
AnswerRe: FormBoardStyle Pin
Amar Chaudhary6-Oct-06 19:53
Amar Chaudhary6-Oct-06 19:53 
GeneralRe: FormBoardStyle Pin
leppie6-Oct-06 23:31
leppie6-Oct-06 23:31 
QuestionIterate over cells in DataGridViewColumn Pin
drinkingbird6-Oct-06 17:42
drinkingbird6-Oct-06 17:42 
QuestionCrystal Report Problem Pin
Saleh Mahmoud6-Oct-06 15:10
Saleh Mahmoud6-Oct-06 15:10 
QuestionModule oriented Windows Application... Pin
Kasic Slobodan6-Oct-06 14:21
Kasic Slobodan6-Oct-06 14:21 
AnswerRe: Module oriented Windows Application... Pin
Christian Graus6-Oct-06 23:33
protectorChristian Graus6-Oct-06 23:33 
GeneralRe: Module oriented Windows Application... Pin
Kasic Slobodan7-Oct-06 9:40
Kasic Slobodan7-Oct-06 9:40 
GeneralRe: Module oriented Windows Application... Pin
S. Senthil Kumar8-Oct-06 2:46
S. Senthil Kumar8-Oct-06 2:46 
GeneralRe: Module oriented Windows Application... Pin
Kasic Slobodan8-Oct-06 6:50
Kasic Slobodan8-Oct-06 6:50 
QuestionCoding for the Vista GUI Pin
rvp717y6-Oct-06 12:52
rvp717y6-Oct-06 12:52 
AnswerRe: Coding for the Vista GUI Pin
Daniel Grunwald7-Oct-06 0:31
Daniel Grunwald7-Oct-06 0:31 
GeneralRe: Coding for the Vista GUI Pin
rvp717y7-Oct-06 14:47
rvp717y7-Oct-06 14:47 

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.