Click here to Skip to main content
15,913,199 members
Home / Discussions / C#
   

C#

 
Questionsave to the database.please help.sos with the code. Pin
sakis2415-Oct-08 6:40
sakis2415-Oct-08 6:40 
AnswerRe: save to the database.please help.sos with the code. Pin
Dave Kreskowiak15-Oct-08 7:49
mveDave Kreskowiak15-Oct-08 7:49 
GeneralRe: save to the database.please help.sos with the code. Pin
sakis2416-Oct-08 8:45
sakis2416-Oct-08 8:45 
Questiondithering Pin
afjepoifesahie15-Oct-08 6:38
afjepoifesahie15-Oct-08 6:38 
AnswerRe: dithering Pin
Dave Kreskowiak15-Oct-08 7:45
mveDave Kreskowiak15-Oct-08 7:45 
GeneralRe: dithering Pin
Anthony Mushrow15-Oct-08 7:50
professionalAnthony Mushrow15-Oct-08 7:50 
QuestionCheck for Table and Create Table if it is not found Pin
Planker15-Oct-08 5:43
Planker15-Oct-08 5:43 
AnswerRe: Check for Table and Create Table if it is not found Pin
Wendelius15-Oct-08 7:52
mentorWendelius15-Oct-08 7:52 
Not quite sure what the problem is but perhaps a little bit different approach could be useful to you:

  • create a class that represents a table with properties such as table name, create statement, to be created bit (which defaults to true)
  • create an instance for all of your tables
  • place the created instances to a generic dictionary (Dictionary<string,>), place the table name to the key of the dictionary item
  • after this get the schema
  • loop every row found from schema and set the corresponding item in the dictionary to not to create the table
  • after this you can loop the dictionary and execute every create statement from the instances where create bit is still true
  • the instances can be created based on for example a xml file if you want to add tables without modifying the code (in this case take good care for the seurity issues)

Hope this helps,

Mika

The need to optimize rises from a bad design.

My articles[^]

GeneralRe: Check for Table and Create Table if it is not found Pin
Planker15-Oct-08 8:17
Planker15-Oct-08 8:17 
GeneralRe: Check for Table and Create Table if it is not found Pin
Wendelius15-Oct-08 8:23
mentorWendelius15-Oct-08 8:23 
QuestionC# Code Help Pin
boiDev15-Oct-08 5:30
boiDev15-Oct-08 5:30 
AnswerRe: C# Code Help Pin
Pedram Behroozi15-Oct-08 5:54
Pedram Behroozi15-Oct-08 5:54 
GeneralRe: C# Code Help Pin
boiDev15-Oct-08 6:57
boiDev15-Oct-08 6:57 
AnswerLET ME DROP EVERYTHING AND WORK ON YOUR PROBLEM Pin
Le centriste15-Oct-08 6:26
Le centriste15-Oct-08 6:26 
GeneralRe: LET ME DROP EVERYTHING AND WORK ON YOUR PROBLEM Pin
boiDev15-Oct-08 6:28
boiDev15-Oct-08 6:28 
GeneralRe: LET ME DROP EVERYTHING AND WORK ON YOUR PROBLEM Pin
Le centriste15-Oct-08 6:29
Le centriste15-Oct-08 6:29 
GeneralRe: LET ME DROP EVERYTHING AND WORK ON YOUR PROBLEM Pin
boiDev15-Oct-08 6:50
boiDev15-Oct-08 6:50 
JokeRe: C# Code Help Pin
nelsonpaixao15-Oct-08 14:00
nelsonpaixao15-Oct-08 14:00 
AnswerRe: C# Code Help Pin
Lea Hayes17-Oct-08 4:32
Lea Hayes17-Oct-08 4:32 
GeneralRe: C# Code Help Pin
boiDev17-Oct-08 5:14
boiDev17-Oct-08 5:14 
QuestionC# Help Urgent Pin
boiDev15-Oct-08 5:13
boiDev15-Oct-08 5:13 
AnswerRe: C# Help Urgent - OH NO ITS NOT!!!!!!!!!!!!!!! Pin
Ashfield15-Oct-08 5:17
Ashfield15-Oct-08 5:17 
GeneralRe: C# Help Urgent - OH NO ITS NOT!!!!!!!!!!!!!!! Pin
boiDev15-Oct-08 5:19
boiDev15-Oct-08 5:19 
GeneralRe: C# Help Urgent - OH NO ITS NOT!!!!!!!!!!!!!!! Pin
J4amieC15-Oct-08 5:50
J4amieC15-Oct-08 5:50 
GeneralRe: C# Help Urgent - OH NO ITS NOT!!!!!!!!!!!!!!! Pin
Paul Conrad15-Oct-08 6:47
professionalPaul Conrad15-Oct-08 6: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.