Click here to Skip to main content
15,915,019 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiondefault html file is opening when run my application Pin
rk2krishna2-Apr-14 21:21
rk2krishna2-Apr-14 21:21 
AnswerRe: default html file is opening when run my application Pin
Tom Marvolo Riddle2-Apr-14 23:40
professionalTom Marvolo Riddle2-Apr-14 23:40 
AnswerRe: default html file is opening when run my application Pin
Sulaiman_J3-Apr-14 0:17
Sulaiman_J3-Apr-14 0:17 
AnswerRe: default html file is opening when run my application Pin
SRKarn10-Apr-14 6:18
SRKarn10-Apr-14 6:18 
QuestionFree 3d chart controls for ASP.Net Pin
Kandepu Rajesh2-Apr-14 11:37
Kandepu Rajesh2-Apr-14 11:37 
AnswerRe: Free 3d chart controls for ASP.Net Pin
Kornfeld Eliyahu Peter2-Apr-14 18:27
professionalKornfeld Eliyahu Peter2-Apr-14 18:27 
GeneralRe: Free 3d chart controls for ASP.Net Pin
Schatak4-Apr-14 3:28
professionalSchatak4-Apr-14 3:28 
QuestionI am trying to have users update their profiles as soon as they log in Pin
samflex1-Apr-14 13:06
samflex1-Apr-14 13:06 
Hi Experts,

I am not real sure why this code doesn't work any more.

When a user logs into the system, we perform a check based on his/her session Id to see if his/her profile is update to date.

If any field on his/her profile page is blank, display a message informing him/her to update his/her personal profile.

It stopped working.

I think the reason it stopped working is that when you query the database, no rows are returned. All are blank.

Does anyone know what I have to do to fix this?

VB
If Not IsPostBack Then
    Dim myConnectionString As [String] = ConfigurationManager.ConnectionStrings("DBConnectionString").ConnectionString
    Dim myConnection As New SqlConnection(myConnectionString)
    Dim nameTB As String
    Dim AddressTB As String
    Dim emailTB As String
    Dim phoneTB As String
    Dim PrecinctTB As String
    Dim PositionTB As String
    Try
        myConnection.Open()

        '*
        '                         * Find personal info
        '

        Dim cmd2 As New SqlCommand("Select l.FullName,l.address,l.Phone_nbr,l.email,l.precinct,p.position_title  from Users l inner join Positions p on l.positionId = p.positionId and l.username = @username", myConnection)
        cmd2.Parameters.AddWithValue("@username", Session("username"))
        cmd2.Parameters.AddWithValue("@email", Session("UserId"))
        Dim dr2 As SqlDataReader = cmd2.ExecuteReader()
        If dr2.Read() Then
            nameTB = dr2("FullName").ToString()
            AddressTB = dr2("address").ToString()
            phoneTB = dr2("phone_nbr").ToString()
            emailTB = dr2("email").ToString()
            PrecinctTB = dr2("precinct").ToString()
            PositionTB = dr2("Position_title").ToString()
            dr2.Close()
            If nameTB = "" Or AddressTB = "" Or phoneTB = "" Or emailTB = "" Or PrecinctTB = "" Or PositionTB = "" Then
                lblMessage.Text = "Please update your personal information"
            Else
            End If
            lblMessage.Text = ""
        End If


    Catch ex As SqlException
        Response.Write("<SCRIPT LANGUAGE='JavaScript'>alert('" + ex.Message + "')</SCRIPT>")
    Finally
        myConnection.Close()
    End Try
End If


Thanks a lot in advance
AnswerRe: I am trying to have users update their profiles as soon as they log in Pin
Kornfeld Eliyahu Peter1-Apr-14 20:04
professionalKornfeld Eliyahu Peter1-Apr-14 20:04 
AnswerRe: I am trying to have users update their profiles as soon as they log in Pin
Blikkies2-Apr-14 1:07
professionalBlikkies2-Apr-14 1:07 
GeneralRe: I am trying to have users update their profiles as soon as they log in Pin
samflex2-Apr-14 3:59
samflex2-Apr-14 3:59 
QuestionParser Error Message: Could not load type 'DIS.CnpWeb.ORFfvpProd.Global'. Pin
indian1431-Apr-14 11:05
indian1431-Apr-14 11:05 
AnswerRe: Parser Error Message: Could not load type 'DIS.CnpWeb.ORFfvpProd.Global'. Pin
Richard MacCutchan1-Apr-14 22:14
mveRichard MacCutchan1-Apr-14 22:14 
GeneralRe: Parser Error Message: Could not load type 'DIS.CnpWeb.ORFfvpProd.Global'. Pin
indian1432-Apr-14 6:02
indian1432-Apr-14 6:02 
GeneralRe: Parser Error Message: Could not load type 'DIS.CnpWeb.ORFfvpProd.Global'. Pin
Richard MacCutchan2-Apr-14 6:31
mveRichard MacCutchan2-Apr-14 6:31 
GeneralRe: Parser Error Message: Could not load type 'DIS.CnpWeb.ORFfvpProd.Global'. Pin
indian1432-Apr-14 7:54
indian1432-Apr-14 7:54 
GeneralRe: Parser Error Message: Could not load type 'DIS.CnpWeb.ORFfvpProd.Global'. Pin
indian1433-Apr-14 6:12
indian1433-Apr-14 6:12 
QuestionUmbraco integration with asp.net mvc3 Pin
Sachin Chinchwade1-Apr-14 2:37
Sachin Chinchwade1-Apr-14 2:37 
AnswerRe: Umbraco integration with asp.net mvc3 Pin
Kornfeld Eliyahu Peter1-Apr-14 10:10
professionalKornfeld Eliyahu Peter1-Apr-14 10:10 
QuestionFailed to load viewstate in gridview and gridview row count Pin
Mary_Prin31-Mar-14 19:48
Mary_Prin31-Mar-14 19:48 
QuestionAccordion RadioButtonList Pin
Member 1038659531-Mar-14 11:35
Member 1038659531-Mar-14 11:35 
AnswerRe: Accordion RadioButtonList Pin
Tom Marvolo Riddle2-Apr-14 19:51
professionalTom Marvolo Riddle2-Apr-14 19:51 
Questionapostrophe Pin
praveenmachat30-Mar-14 8:47
praveenmachat30-Mar-14 8:47 
AnswerRe: apostrophe Pin
Tom Marvolo Riddle30-Mar-14 19:20
professionalTom Marvolo Riddle30-Mar-14 19:20 
AnswerRe: apostrophe Pin
Bernhard Hiller30-Mar-14 22:54
Bernhard Hiller30-Mar-14 22:54 

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.