I am beginner, so please help me with these problem i am suffering

I). I have a coding in ASP.net i want to display list of information from my database (MS Sql 2008 R2) to a table.

My database contain:
Name
Email
Address
Phone

I want this to be displayed in a table. or Gridview but code should be in code behind. I tried doing to code behind with grid view but it didn't work

II). On the next page i have a list. User enters few stuffs in a text boxs. When he clicks on done. Program shows what u have type. And when user clicks on Add button. Data is been added in a table

example:
Enter the food you want
Enter number of food items you want
Enter (To-Go or Eat right now)
Enter additional item you want

// After adding user clicks on done
It shows You have entered "BLAH BLAH" (BLAH BLAH means whatever data you have entered)

Till this i have done it but i an not able to enter this data when user clicks on add. The Data should go to table. When ever data is been added it should go to table with showing previous item added.

Please help me asap.

I am a beginner and i want to get knowledge how to design and code. So please guide me.

I would appreciate you help

Recommended Answers

All 3 Replies

What was the error you encountered when trying to bind data to the gridview from the code behind page?

Its going to be difficult to provide you with an answer since you are looking for guidance and do not have a specific question. What first comes to my mind is that have you taken a look at Microsoft's official page for asp? http://asp.net

@ITG-JM: Thank you for your reply. Well as error was coming i removed it so i don't remember what was the error. Well i looked at http://asp.net site but i didn't got answers from that site. Thats why i have posted my questions(problem) to this site.

In clear and short sentence here is my question

  1. how can i display my database item to a table
  2. Suppose there is a form on my asp.net webpage. After filling out the form. It displays what data your have entered. So if user confirms(Click on Add button) The data should be added in a table. How should i do that data should be added in Table. Whenever data is added the previous added data should be there.

I don't think anybody is going to write your application for you, you're asking for LOTS of code. Below are a few pointers in the right direction.

  1. Do you have a database set up in SQL Server or other?
  2. You need a way of accessing the data. Your options are LINQtoSQL, EntityFramework and oledb (There are others but i suggest one of these, probably linq)
  3. You should learn how to use LINQ - See here
    http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx
  4. You should learn how to trigger events by clicking a button and displaying data from a text box.
  5. When you have learned the above it should be much more simple to create your application.
  6. When you have successfully output your data from the database, simply bind your linq query result to a gridview. (var query = ( [rest of linq query]).ToList(); gridview.datasource = query;

I hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.