Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

VB.Net Datagridview Datasource v/s SQL Query Problem

$
0
0

Respected Sir, 

I want to change cell values of datagridview. 
but after i applied unbound datasource below

datagridview.datasource=datatable.copy

it doesn't respond to change values of any cell dynamically


1) Below Query Let Not Change the VB.Net Datagridview Cell Content: 

strSQL = "Select Row_Number() Over (Order By A.Id) As SN, A.Id, A.Face As [Object Name],B.Visi,B.AddNew,B.Edit,B.Del,B.Prnt,B.Reg,B. XL,B.Txt,B.Email from MSG_URightMaster A " strSQL = strSQL & "Left Join MSG_URight B On A.Id=B.RightId Where B.UserId='" & flxGroup(flxGroup.Row, 1) & "' " 


2) I have also used below query which is perfect and I am able to change any cell content: 

DIM strSQL as string Below Query Let Change the VB.Net Datagridview Cell Content: strSQL = "Select Row_Number() Over (Order By A.Id) As SN, A.Id, A.Face As [Object Name], " strSQL = strSQL & "(Select B.Visi From MSG_URight B Where A.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As Visi, " strSQL = strSQL & "(Select B.AddNew From MSG_URight B Where A.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As AddNew, " strSQL = strSQL & "(Select B.Edit From MSG_URight B Where A.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As Edit, " strSQL = strSQL & "(Select B.Del From MSG_URight B WhereA.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As Del, " strSQL = strSQL & "(Select B.Prnt From MSG_URight B Where A.Id=B.RightId And B.UserId='" &a 
mp; flxGroup(flxGroup.Row, 1) & "') As Prnt, " strSQL = strSQL & "(Select B.Reg From MSG_URight B Where A.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As Reg, " strSQL = strSQL & "(Select B.XL From MSG_URight B WhereA.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As XL, " strSQL = strSQL & "(Select B.Txt From MSG_URight B Where A.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As Txt, " strSQL = strSQL & "(Select B.Email From MSG_URight B Where A.Id=B.RightId And B.UserId='" & flxGroup(flxGroup.Row, 1) & "') As Email " strSQL = strSQL & "From MSG_URightMaster A Order By A.ID " 


I am so confused. Could you please advise why? 


Kindly suggest how to change the cell value as it's in bound mode. 


Regards- 
Sanjeeb


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>