View Single Post
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 27
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: How do you connect to a sql database using C#

 
0
  #4
Apr 11th, 2005
Here is an example of the principles of ADO.Net

pseudocode
  1. ...
  2. Sqldataadapter custAdapter = new SqlDataAdapter("SELECT * FROM Customers", thisConnection);
  3. custAdapter.Fill(thisDataSet, "Customers");
  4. foreach (DataRow custRow in thisDataSet.Tables["CustomerID"].Rows)
  5. {
  6. if (custRow["City"].ToString() == "Madrid")
  7. {
  8. Console.WriteLine("Customer ID: " + custRow["CustomerID"]);
  9. }
  10. }


Hope this helps.
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote