PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

Can't use the automatic UPDATE (SQLDataSource) in GridView for ASPNETDB?!

 
 
stockblaster@gmail.com
Guest
Posts: n/a
 
      20th Dec 2005
Hello

I am displaying into a GridView the ASPNETDB content (that was created
with the login control of ASP.NET 2.0) why doesn't the SQLDataSource
let me use the UPDATE method..
When i click Advanced on the SQLDataSource configuration those options
are greyed..

Any suggestion? i really need to be able to update the ASPNETDB ....

Regards..

 
Reply With Quote
 
 
 
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      20th Dec 2005
The most likely culprit is that the table doesn't have a key on it or the
Select query has a join in it. Can you verify this for me? If you don't
have a key (or if your query has a join in it) then all of the automatic
ways of generating update logic won't work.
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I am displaying into a GridView the ASPNETDB content (that was created
> with the login control of ASP.NET 2.0) why doesn't the SQLDataSource
> let me use the UPDATE method..
> When i click Advanced on the SQLDataSource configuration those options
> are greyed..
>
> Any suggestion? i really need to be able to update the ASPNETDB ....
>
> Regards..
>



 
Reply With Quote
 
onearth
Guest
Posts: n/a
 
      20th Dec 2005
"W.G. Ryan - MVP" wrote:
>The most likely culprit is that the table doesn't have a key on it or

the
>Select query has a join in it. Can you verify this for me? If you

don't
>have a key (or if your query has a join in it) then all of the

automatic
>ways of generating update logic won't work.


Hello

Thank you for the reply.
the SELECT statment doesn't have join in.. notice the strange thing that
the table name is vw_aspnet_MembershipUsers (vw?)..
Notice that if i put other table that i have made my self everything
works simple.. i can update easly, but the ASPNETDB thing, nope..
Here is the source:



<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" DataKeyNames="UserId">
<Columns>
<asp:BoundField DataField="UserId" HeaderText="UserId"
SortExpression="UserId" />
<asp:BoundField DataField="PasswordFormat"
HeaderText="PasswordFormat" SortExpression="PasswordFormat" />
<asp:BoundField DataField="MobilePIN" HeaderText="MobilePIN"
SortExpression="MobilePIN" />

**** ETC...****

</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:UserBase %>"
SelectCommand="SELECT * FROM
[vw_aspnet_MembershipUsers]"></asp:SqlDataSource>


--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
 
Reply With Quote
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      20th Dec 2005
Onearth - yah, that's the problem. You're accessing a view that's not
intended to be written to - sorry for the bad news.
--------------------------------------
The SQL Server provider database provides several views that enable you to
access the data for a particular feature without accessing the database
tables directly. The views provided are for read access only. You should not
attempt to update the data in the database using the views. All updates
should be made using the .NET Framework classes for each feature.

-------------------------------------------------------
"onearth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "W.G. Ryan - MVP" wrote:
>>The most likely culprit is that the table doesn't have a key on it or

> the
>>Select query has a join in it. Can you verify this for me? If you

> don't
>>have a key (or if your query has a join in it) then all of the

> automatic
>>ways of generating update logic won't work.

>
> Hello
>
> Thank you for the reply.
> the SELECT statment doesn't have join in.. notice the strange thing that
> the table name is vw_aspnet_MembershipUsers (vw?)..
> Notice that if i put other table that i have made my self everything
> works simple.. i can update easly, but the ASPNETDB thing, nope..
> Here is the source:
>
>
>
> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
> DataSourceID="SqlDataSource1" DataKeyNames="UserId">
> <Columns>
> <asp:BoundField DataField="UserId" HeaderText="UserId"
> SortExpression="UserId" />
> <asp:BoundField DataField="PasswordFormat"
> HeaderText="PasswordFormat" SortExpression="PasswordFormat" />
> <asp:BoundField DataField="MobilePIN" HeaderText="MobilePIN"
> SortExpression="MobilePIN" />
>
> **** ETC...****
>
> </Columns>
> </asp:GridView>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString="<%$ ConnectionStrings:UserBase %>"
> SelectCommand="SELECT * FROM
> [vw_aspnet_MembershipUsers]"></asp:SqlDataSource>
>
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com



 
Reply With Quote
 
onearth
Guest
Posts: n/a
 
      20th Dec 2005
Hello

Thank for your reply.. i am now really disappointed since i will have to
remove all the login controls and do it manually... I must have a
GridView or any Grid View to be able to manage my userbase from the
web... If i knew this before i wouldn't have used the login controls in
the first place...

or i can do this manually? notice that i added a few fields of my own
into the aspnet_Membership.





--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Row in GridView using SqlDataSource and update to database ? Luqman Microsoft ASP .NET 5 22nd Nov 2007 11:44 AM
configuring sqldatasource to use a stored procedure from the aspnetdb Ryan Microsoft ASP .NET 0 24th May 2007 10:55 PM
Gridview update with sqldatasource and dropdown Will Microsoft ASP .NET 0 12th Jan 2007 04:34 PM
Dynamic SQLDataSource with Gridview - Update Parameters OceanTragic Microsoft ASP .NET 0 14th Nov 2006 12:01 PM
How to update the ASPNETDB file (login control) with a GridView (asp.net 2.0) stockblaster@gmail.com Microsoft Dot NET Framework 1 20th Dec 2005 11:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:05 PM.