473,379 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

retrieving data from a database (sql server)

553 512MB
Hi

What is the best data collection method to store data from database in the following format:

Table: Customers
Fields: Name, Address, Telephone

Is HashTable good, or something else you would recommend? If its hashtable, what would be the key since there are all "string" data type in the table. Also, since there are more than one field i.e Address, Telephone, how would i save these in the hashtable? Will i need to create a class having these fields and create an object that i will add in the hashtable?

Any ideas?

thanks
Jun 21 '09 #1
4 1902
PRR
750 Expert 512MB
In order to retrieve data from database you need to connect to database (ADO.NET). You need Sqlconnection, Sqlcommand objects along with Datareader or dataadapter.
The following articles will be quite helpful
How to use DB
How to use DB Part2
Jun 22 '09 #2
Curtis Rutland
3,256 Expert 2GB
If you are new to using Databases in your .NET programs, check out the two links that PRR provided (one of those articles is written by me ;) )

But I would also suggest learning to use LINQ to SQL.
http://msdn.microsoft.com/en-us/library/bb425822.aspx
http://weblogs.asp.net/scottgu/archi...ql-part-1.aspx

It is amazingly easy to use, and very powerful.
Jun 24 '09 #3
PRR
750 Expert 512MB
Very well written articles... Perhaps you should consider writing article on LINQ to SQL :)
Jun 25 '09 #4
Curtis Rutland
3,256 Expert 2GB
Maybe one day soon, but I'm still learning it as well. It is amazing though, it can really streamline your project. Try it out if you can, just set up a test project and start playing around with the objects it creates.
Jun 25 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Krakatioison | last post by:
Hi everyone, can someone point me to download of an example for saving and retrieving to/from MYSQL database. Or did anyone of you tried this and could share your code with me. I've got some data...
6
by: Dean Slindee | last post by:
Does anybody have an actual example of retrieving an Image data type column from a SQL Server table using a dataset (not a datareader)? I would like to see the statements that would move the...
0
by: kid4rilla | last post by:
I can successfully write the binary data to an image data type, and successfully retrieve it, but when I attempt to play the file in media player after retrieving it, I get the file type isn't...
0
by: Andy | last post by:
Hi All. I'm working for a company that has set out a guideline for retrieving data from a database. Nobody can explain to me the reason for the following. When retrieving a set of records...
17
by: Rico | last post by:
Hello, I am in the midst of converting an Access back end to SQL Server Express. The front end program (converted to Access 2003) uses DAO throughout. In Access, when I use recordset.AddNew I...
7
by: Sirplaya | last post by:
I am retrieving images that I stored in SQL Server on my web pages in C#. I have no problem with the images displaying, however, I am trying to wrap the image with an <A HREF ..." and each time I...
11
by: Nemisis | last post by:
Hi everyone, sorry if this post gets really long, i just wanna make sure i fully explain what i am trying to do. I am new to OOP and .net 2.0, so if this is obvious, i am sorry. I have wrote a...
5
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is retrieved in under a second. When retrieving using the...
1
by: san123456789 | last post by:
Hi, Im using a MS SQL server to store images... Im creating a windows form application using C#. I need to store and retrieve images from the database. This is my code to store images: ...
1
by: inlovewithmusic | last post by:
Hi , I am trying to write a piece of funtionality that will store a string array into into a database and then later retrieve it for viewing later. I wrote the funtionality to insert the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.