Page 1 of 1

ASP.Net VB Dataview Insert, Update, and Delete example

Posted: Fri 07 Jul 2006 19:31
by bpryer
I am extremely new to ASP.net so sorry for sound stupid. I am in desperate need of an ASP.net using VB example of a dataview that will update, delete, and insert. I have searched numerous places on the web that only provided code that only further confused me. Can anyone provide an example of a dataview that updates, inserts and deletes?

Any help is much appreciated.

thank you,

Brenton

Posted: Mon 10 Jul 2006 11:34
by Alexey
Place GridView component onto a form, choose "Choose Data Source" -> and configure it.

ASP.Net VB Dataview Insert, Update, and Delete example

Posted: Mon 10 Jul 2006 22:40
by bpryer
I've got that far, but when I try and update, the grid or database is not effected. Should I do this programatically (if so, an example would be nice) or should I use the standard code generated by VS 2005?

Brent

Posted: Tue 11 Jul 2006 06:15
by Alexey
Did you tick appropriate checkbox for Update command generation while configuring SqlDataSource component?

ASP.Net VB Dataview Insert, Update, and Delete example

Posted: Thu 13 Jul 2006 16:00
by bpryer
the SQLDataSource wouldn't let me check the Generate update commands.

I am not sure why I cant do this. Everything i am reading seems like this is an easy thing to do.

thank you,

Brent

Posted: Fri 14 Jul 2006 06:17
by Alexey
the SQLDataSource wouldn't let me check the Generate update commands.
Does this mean that the checkbox is disabled?

Datagrid Update

Posted: Fri 14 Jul 2006 21:54
by bpryer
correct the checkbox is disabled.

Posted: Mon 17 Jul 2006 06:19
by Alexey
We are investigating this problem. You will be notified on results as soon as possible. For the present you can configure SqlDataSource programmatically:

Code: Select all

        
            
                
            
        
        "
            DeleteCommand="DELETE FROM dept WHERE DEPTNO = ?" InsertCommand="INSERT INTO dept (DEPTNO, DNAME, LOC) VALUES (?, ?, ?)"
            ProviderName="" SelectCommand="SELECT * FROM dept"
            UpdateCommand="UPDATE dept SET DNAME = ?, LOC = ? WHERE DEPTNO = ?">