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

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

Postby bpryer » Fri 07 Jul 2006 19:31

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
bpryer
 
Posts: 4
Joined: Fri 07 Jul 2006 19:03

Postby Alexey » Mon 10 Jul 2006 11:34

Place GridView component onto a form, choose "Choose Data Source" -> and configure it.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

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

Postby bpryer » Mon 10 Jul 2006 22:40

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
bpryer
 
Posts: 4
Joined: Fri 07 Jul 2006 19:03

Postby Alexey » Tue 11 Jul 2006 06:15

Did you tick appropriate checkbox for Update command generation while configuring SqlDataSource component?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

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

Postby bpryer » Thu 13 Jul 2006 16:00

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
bpryer
 
Posts: 4
Joined: Fri 07 Jul 2006 19:03

Postby Alexey » Fri 14 Jul 2006 06:17

the SQLDataSource wouldn't let me check the Generate update commands.

Does this mean that the checkbox is disabled?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Datagrid Update

Postby bpryer » Fri 14 Jul 2006 21:54

correct the checkbox is disabled.
bpryer
 
Posts: 4
Joined: Fri 07 Jul 2006 19:03

Postby Alexey » Mon 17 Jul 2006 06:19

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
                    DataSourceID="SqlDataSource1">
           
               
           

       

        "
            DeleteCommand="DELETE FROM dept WHERE DEPTNO = ?" InsertCommand="INSERT INTO dept (DEPTNO, DNAME, LOC) VALUES (?, ?, ?)"
            ProviderName="<%$ ConnectionStrings:testConnectionString.ProviderName %>" SelectCommand="SELECT * FROM dept"
            UpdateCommand="UPDATE dept SET DNAME = ?, LOC = ? WHERE DEPTNO = ?">
           
               
           

           
               
               
               
           

           
               
               
               
           

       
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for PostgreSQL