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

C#

 
AnswerRe: Executing programs Pin
Stefan Troschuetz5-Oct-05 23:48
Stefan Troschuetz5-Oct-05 23:48 
GeneralRe: Executing programs Pin
Stefan_ Spenz6-Oct-05 1:51
Stefan_ Spenz6-Oct-05 1:51 
AnswerRe: Executing programs Pin
User 66586-Oct-05 1:41
User 66586-Oct-05 1:41 
GeneralRe: Executing programs Pin
Stefan_ Spenz6-Oct-05 1:52
Stefan_ Spenz6-Oct-05 1:52 
Questionhow to get the target of shortcut Pin
Anonymous5-Oct-05 22:27
Anonymous5-Oct-05 22:27 
AnswerRe: how to get the target of shortcut Pin
Heath Stewart6-Oct-05 7:28
protectorHeath Stewart6-Oct-05 7:28 
QuestionDatabase query Pin
ybasha5-Oct-05 21:39
ybasha5-Oct-05 21:39 
AnswerRe: Database query Pin
Heath Stewart6-Oct-05 6:43
protectorHeath Stewart6-Oct-05 6:43 
First, you do not need to open a connection when using a DataAdapter derivative. The DataAdapter will open and close the connection as necessary.

Second, to avoid connecting back to the server multiple times - and for large data sets this could require a tremendous amount of time on the user's part and lots of bandwidth on your server - have SQL Server do the work using joins like the following example:
select o.* from Orders o left outer join Customers c on o.CustomerID = c.CustomerID
Third, you can implement relationships in your DataSet between DataTables using a DataRelation. In Visual Studio, if you add a new DataSet class to your project you can import these tables from Server Explorer (or author them yourself, but this takes more time and is prone to error) then draw relationships between fields from different tables. This creates the DataRelation for you. Be sure to look at the code to see how it's done, or read the documentation[^] for the class for an example.

Your SqlCommand for your SqlDataAdapter then should have two SQL statements in one command to fill each table (separated by a semicolon) or swap the SqlDataAdapter.SelectCommand with second command and fill the same table with a different table mapping (the previous data would be saved).

Then you'd have a DataSet with everything you need already with only a one (or two, if you do the latter suggestion of a second command and calling DataAdapter.Fill again) connection to the server. This would be a much more efficient use of network bandwidth and the database server that is designed to handle this sort of query.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft

[My Articles] [My Blog]
QuestionSearching for a string value Pin
Brendan Vogt5-Oct-05 20:37
Brendan Vogt5-Oct-05 20:37 
AnswerRe: Searching for a string value Pin
S. Senthil Kumar5-Oct-05 20:45
S. Senthil Kumar5-Oct-05 20:45 
GeneralRe: Searching for a string value Pin
Brendan Vogt5-Oct-05 21:01
Brendan Vogt5-Oct-05 21:01 
GeneralRe: Searching for a string value Pin
S. Senthil Kumar5-Oct-05 21:12
S. Senthil Kumar5-Oct-05 21:12 
GeneralRe: Searching for a string value Pin
Brendan Vogt5-Oct-05 21:55
Brendan Vogt5-Oct-05 21:55 
AnswerRe: Searching for a string value Pin
Guffa5-Oct-05 23:01
Guffa5-Oct-05 23:01 
GeneralRe: Searching for a string value Pin
Brendan Vogt5-Oct-05 23:10
Brendan Vogt5-Oct-05 23:10 
AnswerRe: Searching for a string value Pin
Guffa6-Oct-05 0:22
Guffa6-Oct-05 0:22 
GeneralRe: Searching for a string value Pin
Brendan Vogt6-Oct-05 0:41
Brendan Vogt6-Oct-05 0:41 
GeneralRe: Searching for a string value Pin
Guffa6-Oct-05 1:20
Guffa6-Oct-05 1:20 
QuestionSetup starts after installation again Pin
Ariadne5-Oct-05 20:31
Ariadne5-Oct-05 20:31 
AnswerRe: Setup starts after installation again (minor bug) Pin
Ariadne6-Oct-05 20:14
Ariadne6-Oct-05 20:14 
QuestionSockets in C# Pin
Thoughthopper5-Oct-05 20:04
Thoughthopper5-Oct-05 20:04 
Questionsetup problem Pin
shashank veerkar5-Oct-05 19:40
shashank veerkar5-Oct-05 19:40 
AnswerRe: setup problem Pin
Ariadne5-Oct-05 20:49
Ariadne5-Oct-05 20:49 
QuestionHow to find all fax machines on asystem Pin
shashank veerkar5-Oct-05 18:48
shashank veerkar5-Oct-05 18:48 
QuestionHow to get an array of Pens in a user defined class to "work" in a WinForm? Pin
Anonymous5-Oct-05 16:39
Anonymous5-Oct-05 16:39 

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.