access and vb.net 2005 help

B&W

B&W

Soldato
Joined
3 Oct 2003
Posts
7,668
Location
Birmingham
Hi, I have a datagrid in a form that displays information from a access database.

To add data to this database, you have to open a form enter all the details into textboxes and then use a parameterised query.

I've heard that its possible to edit data directly from the datagrid control, how would I go about doing this?

Also when I search for a unique ID (reference number for me) that each record in a table has I want this to be displayed on textboxes.

Eg, I have a textbox on one form and using this I can search for a particular reference number. How do I make it so that the results of this search are displayed on a series of textboxes on the same form.
 
Also is there a way I can get a professional installer program?

eg, when you download a program from the internet, the main file is usually setup.exe.

Can I get something like this for free?
 
If anyone knows something that could help me with the problems I listed in the first post I would be grateful, if anything is unclear then let me know and I will clarify it.
 
Right, when drop a GridView onto a page you get the step by step wizard popup when you choose New Data Source. You then choose your Data Source Type, then you come to the next screen 'Configure the Select Statement' click on the Advanced button and you will see two tick boxes 'Generate INSERT, UPDATE, DELETE, etc' and 'use OPTMISTIC CURRENCY' make sure these are both ticked. You can then use the gridview to edit data directly.

If you are still unsure check this tutorial out: -

http://www.asp.net/learn/videos/view.aspx?tabid=63&id=7 - Excellent tutorial.
 
Sorry mate I thought you was using ASP.NET - I'm not sure about VB.NET although I guess it would be the same using VB express?
 
thanks for that but found another way to do it.

what about this though, any tips?

Also when I search for a unique ID (reference number for me) that each record in a table has I want this to be displayed on textboxes.

Eg, I have a textbox on one form and using this I can search for a particular reference number. How do I make it so that the results of this search are displayed on a series of textboxes on the same form.
 
update query

Need help on a update query. Basically I select a record from the datagrid, then press a button that opens a new form where I enter all the stuff I want changed into textboxes. Then I press an update button which calls a parameterised query.

At first it would update all the records to what I entered, so I put in SELECT TOP 1 and now it updates just the top record of the table.

How do I get it to edit JUST the record I want.

I presume I need some code in the button I use to open the textboxes form?
 
As part of the datagrid have you got an unique identifier (BlahID)? When you choose a record in the datagrid does it have a select link next to each record? If it does you can pass the unique id using something like this: -

Code:
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim buildqueryString As String
        
        buildqueryString = "View Progress Review.aspx?ReviewID=" & GridView1.SelectedRow.Cells(1).Text
       
        Response.Redirect(buildqueryString)
   
    End Sub
You could either pass the unique id to the next form using a session variable or put it in a querystring like I've done. You could then use that in your SQL UPDATE statement to update the relevant record.

ARHHHHHH OMG - I keep thinking you are using ASP.NET christ I need to stay out of this thread
 
Last edited:
can any1 help me on the following

Also when I search for a unique ID (reference number for me) that each record in a table has I want this to be displayed on textboxes.

Eg, I have a textbox on one form and using this I can search for a particular reference number. How do I make it so that the results of this search are displayed on a series of textboxes on the same form.
 
Back
Top Bottom