Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
AnswerRe: GetNetworkUsageAsync() not working in WindowsRT Pin
Pete O'Hanlon11-Jun-14 3:09
mvePete O'Hanlon11-Jun-14 3:09 
AnswerRe: GetNetworkUsageAsync() not working in WindowsRT Pin
Sharath C V11-Jun-14 3:34
professionalSharath C V11-Jun-14 3:34 
AnswerRe: GetNetworkUsageAsync() not working in WindowsRT Pin
Dave Kreskowiak11-Jun-14 3:12
mveDave Kreskowiak11-Jun-14 3:12 
GeneralRe: GetNetworkUsageAsync() not working in WindowsRT Pin
Sharath C V11-Jun-14 3:38
professionalSharath C V11-Jun-14 3:38 
AnswerRe: GetNetworkUsageAsync() not working in WindowsRT Pin
Sharath C V11-Jun-14 3:30
professionalSharath C V11-Jun-14 3:30 
QuestionWhy have insert new must command line "SET IDENTITY_INSERT TableName ON" save in SQL Server? Pin
Member 245846710-Jun-14 17:13
Member 245846710-Jun-14 17:13 
AnswerRe: Why have insert new must command line "SET IDENTITY_INSERT TableName ON" save in SQL Server? Pin
Mycroft Holmes10-Jun-14 18:02
professionalMycroft Holmes10-Jun-14 18:02 
AnswerRe: Why have insert new must command line "SET IDENTITY_INSERT TableName ON" save in SQL Server? Pin
Swinkaran10-Jun-14 18:37
professionalSwinkaran10-Jun-14 18:37 
As per my understanding you are trying to insert few sample records to the database, however I don't understand why you are doing this through code. Or are you trying to read the records from some source and feeding into the database? If that is the case you should use those lines,
SQL
SET IDENTITY_INSERT [table_name] ON
SET IDENTITY_INSERT [table_name] OFF

For each records inserts.

Alternatively you can set,
SQL
SET IDENTITY_INSERT [table_name] ON -- At the beginning
INSERT [table_name] ([ID],,,) VALUES (1,,,)
INSERT [table_name] ([ID],,,) VALUES (2,,,)
....
....
SET IDENTITY_INSERT [table_name] OFF -- Terminate after finished inserting all the sample records


However, I don't use this inside the Data access layer. I don't set the identity for the record. Set it to Auto increment for best practice.
AnswerRe: Why have insert new must command line "SET IDENTITY_INSERT TableName ON" save in SQL Server? Pin
Kornfeld Eliyahu Peter10-Jun-14 20:17
professionalKornfeld Eliyahu Peter10-Jun-14 20:17 
AnswerRe: Why have insert new must command line "SET IDENTITY_INSERT TableName ON" save in SQL Server? Pin
Kumarbs10-Jun-14 20:33
professionalKumarbs10-Jun-14 20:33 
AnswerRe: Why have insert new must command line "SET IDENTITY_INSERT TableName ON" save in SQL Server? Pin
Member 245846711-Jun-14 16:40
Member 245846711-Jun-14 16:40 
QuestionRTF to HTML Converter troubled method Pin
Marnus Steyn10-Jun-14 8:37
Marnus Steyn10-Jun-14 8:37 
AnswerRe: RTF to HTML Converter troubled method Pin
Pete O'Hanlon10-Jun-14 10:11
mvePete O'Hanlon10-Jun-14 10:11 
QuestionBackgroundWorker problem Pin
Member 1053008210-Jun-14 3:19
Member 1053008210-Jun-14 3:19 
AnswerRe: BackgroundWorker problem Pin
Pete O'Hanlon10-Jun-14 3:58
mvePete O'Hanlon10-Jun-14 3:58 
QuestionNot able to use PathGradientBrush in WPF Pin
Member 329381510-Jun-14 1:08
Member 329381510-Jun-14 1:08 
AnswerRe: Not able to use PathGradientBrush in WPF Pin
Pete O'Hanlon10-Jun-14 1:44
mvePete O'Hanlon10-Jun-14 1:44 
AnswerRe: Not able to use PathGradientBrush in WPF Pin
Richard MacCutchan10-Jun-14 2:22
mveRichard MacCutchan10-Jun-14 2:22 
QuestionWPF - Load Gmail contact list in ListView with status icon Pin
Member 102676309-Jun-14 20:35
Member 102676309-Jun-14 20:35 
AnswerRe: WPF - Load Gmail contact list in ListView with status icon Pin
Pete O'Hanlon9-Jun-14 21:12
mvePete O'Hanlon9-Jun-14 21:12 
QuestionA console application to a WPF Pin
bunny039-Jun-14 14:12
bunny039-Jun-14 14:12 
AnswerRe: A console application to a WPF Pin
Dave Kreskowiak9-Jun-14 18:14
mveDave Kreskowiak9-Jun-14 18:14 
AnswerRe: A console application to a WPF Pin
Richard MacCutchan9-Jun-14 20:59
mveRichard MacCutchan9-Jun-14 20:59 
AnswerRe: A console application to a WPF Pin
Manikandan1011-Jun-14 3:26
professionalManikandan1011-Jun-14 3:26 
GeneralRe: A console application to a WPF Pin
bunny0312-Jun-14 6:11
bunny0312-Jun-14 6:11 

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.