Update command when using SqlDataSource control in combination with ASP.NET GridView control

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
jordan
Posts: 7
Joined: Tue 28 Mar 2006 08:05

Update command when using SqlDataSource control in combination with ASP.NET GridView control

Post by jordan » Tue 28 Mar 2006 08:15

Does anyone know how to format an Update command in an ASP.NET SqlDataSource control when using it with a GridView control?

I have done it before with SqlServer, but i cannot get it to work with MySql.

This is what i have done:














"
EnableCaching="True" ProviderName=""
SelectCommand="SELECT bstid, bstnam, bstgsl, bstadr, bsthnr, bstpcd, bstplt, bsttel FROM bestel"
UpdateCommand="UPDATE bestel SET bstnam = @bstnam, bstgsl = @bstgsl, bstadr = @bstadr, bsthnr = @bsthnr, bstpcd = @bstpcd, bstplt = @bstplt, bsttel = @bsttel WHERE bstid = @bstid;">


In SqlServer this should work fine. Does anyone know how i can get it to work with the MySQLDirect.NET provider ?

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

Post by Alexey » Tue 28 Mar 2006 10:13

You can do it as foollows:

Code: Select all

"
EnableCaching="True" SelectCommand="SELECT bstid, bstnam, bstgsl, bstadr, bsthnr, bstpcd, bstplt, bsttel FROM bestel" ProviderName="" UpdateCommand="UPDATE bestel SET bstnam = ?, bstgsl = ?, bstadr = ?, bsthnr = ?, bstpcd = ?, bstplt = ?, bsttel = ? WHERE bstid = ?"> 
    
        
        
        
        
        
        
        
        
    
 
This snippet was generated by "Configure Data Source..." wizard for SqlDataSource1 component. If you use it, on the second wizard window press "Advanced..." button and tick appropriate check box.

Post Reply