Click here to Skip to main content
15,908,775 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError Pin
razi_Seyyedi2-May-08 9:01
razi_Seyyedi2-May-08 9:01 
AnswerCP MEMBERS: Ignore post Pin
leckey2-May-08 10:45
leckey2-May-08 10:45 
AnswerRe: Error Pin
mr.mohsen3-May-08 1:09
mr.mohsen3-May-08 1:09 
QuestionHow to restrict an url or images accessing from my site? Pin
Member 38421152-May-08 6:27
Member 38421152-May-08 6:27 
AnswerRe: How to restrict an url or images accessing from my site? Pin
Bursh.2-May-08 10:06
Bursh.2-May-08 10:06 
GeneralRe: How to restrict an url or images accessing from my site? Pin
Member 38421153-May-08 8:58
Member 38421153-May-08 8:58 
GeneralRe: How to restrict an url or images accessing from my site? Pin
Bursh.4-May-08 11:16
Bursh.4-May-08 11:16 
QuestionASP.NET, LINQ, Updating [modified] Pin
Bursh.2-May-08 6:26
Bursh.2-May-08 6:26 
Hey

I'm currently working on a project for myself in which I'm using LINQ to interact with an MSSQL database.

I'm having trouble updating the database, though. I've watched the videos at www.asp.net and I've downloaded and viewed the source code. I think I'm doing the right thing but the database isn't updating at all.

Here's the code:
<br />
Protected Sub EditMode_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles EditMode.Click<br />
        Dim Conn As New ClanDataConnection()<br />
<br />
        Dim UID = Request.QueryString("UID")<br />
<br />
        Dim Query = From user In Conn.aspnet_Memberships _<br />
                    Where user.UserId.ToString() = UID _<br />
                    Select user, user.aspnet_Users<br />
<br />
        Dim newUserName As TextBox = dvUserDetails.FindControl("tbUserNameEdit")<br />
        Dim newEmail As TextBox = dvUserDetails.FindControl("tbEmailEdit")<br />
        Dim newMemberSince As TextBox = dvUserDetails.FindControl("tbCreateDateEdit")<br />
        Dim newLastOnline As TextBox = dvUserDetails.FindControl("tbLastActiveDateEdit")<br />
        Dim newIsApproved As CheckBox = dvUserDetails.FindControl("cbIsApprovedEdit")<br />
<br />
        For Each usr In Query<br />
            usr.user.aspnet_Users.UserName = newUserName.Text<br />
            usr.user.aspnet_Users.LoweredUserName = newUserName.Text.ToLower<br />
            usr.user.Email = newEmail.Text<br />
            usr.user.CreateDate = newMemberSince.Text<br />
            usr.user.aspnet_Users.LastActivityDate = newLastOnline.Text<br />
            usr.user.IsApproved = newIsApproved.Checked<br />
        Next<br />
<br />
        Try<br />
            Conn.SubmitChanges()<br />
        Catch ex As Exception<br />
            lbl.Text = ex.Message<br />
        End Try<br />
<br />
        Server.Transfer("./Screens/SelectUser.aspx")<br />
<br />
    End Sub<br />

(For some reason the code tag has removed my code formatting [tabs] and left it looking disorganised)


No error message is passed and the page successfully moves to the select user page where there is a list of user names in a drop down box. When I look in this box, if I've attempted to change a user name, it hasn't changed. If I go to edit that user again by selecting it, I can see on the edit user page that the detail(s) hasn't changed.

Why is this?

Thanks in advance,
Andy.

P.S: I'm not using a LINQ data source, nor do I want to use one. I'm populating my grid views and data views from dynamically generated data tables and LINQ queries.

Don't you just hate coming up with something to put here?

modified on Friday, May 2, 2008 4:07 PM

AnswerRe: ASP.NET, LINQ, Updating [modified] Pin
Bursh.3-May-08 6:15
Bursh.3-May-08 6:15 
Questionconversion from .net 1.0 to 2.0 Pin
Member 38421152-May-08 6:22
Member 38421152-May-08 6:22 
AnswerRe: conversion from .net 1.0 to 2.0 Pin
Abhijit Jana2-May-08 6:26
professionalAbhijit Jana2-May-08 6:26 
AnswerRe: conversion from .net 1.0 to 2.0 Pin
Member 38421153-May-08 9:07
Member 38421153-May-08 9:07 
QuestionFormView And Dropdownlist control Pin
AmirAlilou2-May-08 6:13
AmirAlilou2-May-08 6:13 
QuestionResponse splitting Pin
dan!sh 2-May-08 3:36
professional dan!sh 2-May-08 3:36 
AnswerRe: Response splitting Pin
eyeseetee2-May-08 3:49
eyeseetee2-May-08 3:49 
GeneralRe: Response splitting Pin
dan!sh 2-May-08 4:16
professional dan!sh 2-May-08 4:16 
AnswerRe: Response splitting Pin
eyeseetee2-May-08 4:39
eyeseetee2-May-08 4:39 
Questionweb application with datagrid.. Pin
mahi2432-May-08 2:58
mahi2432-May-08 2:58 
AnswerRe: web application with datagrid.. Pin
eyeseetee2-May-08 3:09
eyeseetee2-May-08 3:09 
AnswerRe: web application with datagrid.. Pin
leckey2-May-08 3:44
leckey2-May-08 3:44 
QuestionDisplaying filetype icon in Gridview Pin
Banjo Ayorinde2-May-08 2:44
Banjo Ayorinde2-May-08 2:44 
AnswerRe: Displaying filetype icon in Gridview Pin
eyeseetee2-May-08 3:08
eyeseetee2-May-08 3:08 
Questionusin asp.net c# or vb insert multiple rows into sql server 2005 Pin
Sarfaraj Ahmed2-May-08 1:36
Sarfaraj Ahmed2-May-08 1:36 
AnswerRe: usin asp.net c# or vb insert multiple rows into sql server 2005 Pin
Rajesh_K_Sharma2-May-08 2:35
Rajesh_K_Sharma2-May-08 2:35 
GeneralRe: usin asp.net c# or vb insert multiple rows into sql server 2005 Pin
Vasudevan Deepak Kumar2-May-08 2:39
Vasudevan Deepak Kumar2-May-08 2:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.