954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem on Datagrid

I usually create a datagrid in Visual Web Developer to display information from a database because it has a wizard for SQL transactions. Is there a way to program and manage the datagrid using C# as a script? Such as add or delete directly a record from the datagrid and the database is also updated? I make use of Access as my database.

Or are there other ways to do this using C# as my script? Thanks...

ebabes
Junior Poster in Training
73 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

Look up ASP.NET and AJAX. This is what I believe you are referring to. You wish to delete a record by clicking a button on the datagrid, which in turns deletes the row (or hides it) from the datagrid, and then deletes the row from the database, all while avoiding a postback to the server, right?

Can be done and not too hard. Look it up, you'll find some tutorials on AJAX. It is becoming a web standard, so it would be great to know it.

SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
 

Ok thanks a lot. I will visit the postings about my problem.

ebabes
Junior Poster in Training
73 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 
Ok thanks a lot. I will visit the postings about my problem.


hi
are you using asp.net 2005? if yes then the grid provided here is with all the functions you needed. you need not to do any code for that. everything is on default.aspx page only and not in default.c# page.
and if any one need this functionality in vb.net also then get newer version i.e 2008. :)
Best luck.

sbv
Junior Poster
178 posts since Jan 2008
Reputation Points: 15
Solved Threads: 8
 

I'm usng ASP.Net 2005 (Web Developer). I am not aware that there are built in functions provided in the page. What are those functions and how can I make use of it?

Thanks...

ebabes
Junior Poster in Training
73 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 
I'm usng ASP.Net 2005 (Web Developer). I am not aware that there are built in functions provided in the page. What are those functions and how can I make use of it?

Hi ebabes,
Datagrid has built-in functionality as DataBind() and property as DataSource. You need to set DataSet, ArrayList OR Any Collection as DataSource of DataGrid object. After that you can call DataBind() method of DataGrid object.
For ex: in c#, DataGrid_Object.DataSource=DataSet_Object;
DataGrid_Object.DataBind();


There are lots of articles are available on the internet, you can search through google.
Hope this will help you.
If problem persist then feel free to ask any number of questions.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer .Net Consulting

dilipv
Light Poster
30 posts since Feb 2008
Reputation Points: 10
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You