Click here to Skip to main content
14,663,756 members
Home » Discussions » ASP.NET
   

ASP.NET

 
QuestionHTTP Error 500.19 - Internal Server Error - The requested page cannot be accessed because the related configuration data for the page is invalid Pin
simpledeveloper29-Jan-20 12:09
Membersimpledeveloper29-Jan-20 12:09 
AnswerRe: HTTP Error 500.19 - Internal Server Error - The requested page cannot be accessed because the related configuration data for the page is invalid Pin
Richard Deeming30-Jan-20 1:06
mveRichard Deeming30-Jan-20 1:06 
GeneralRe: HTTP Error 500.19 - Internal Server Error - The requested page cannot be accessed because the related configuration data for the page is invalid Pin
simpledeveloper30-Jan-20 14:28
Membersimpledeveloper30-Jan-20 14:28 
Question(SOLVED) Any ideas why gridview is not getting populated with data from the database? Pin
samflex29-Jan-20 9:30
Membersamflex29-Jan-20 9:30 
SuggestionRe: Any ideas why gridview is not getting populated with data from the database? Pin
Richard Deeming30-Jan-20 1:02
mveRichard Deeming30-Jan-20 1:02 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
samflex30-Jan-20 3:58
Membersamflex30-Jan-20 3:58 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
Richard Deeming30-Jan-20 4:05
mveRichard Deeming30-Jan-20 4:05 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
samflex30-Jan-20 4:20
Membersamflex30-Jan-20 4:20 
Yes, sir.

I removed it from the code I posted here yesterday.

Sorry to post the code again but this is how I was calling it:

Protected Sub txtEmpID_TextChanged(sender As Object, e As EventArgs) Handles txtEmpID.TextChanged
  If Not String.IsNullOrEmpty(txtEmpID.Text) Then
      Dim Conn As SqlConnection
      'Read in connection String
      Conn = New SqlConnection(ConfigurationManager.ConnectionStrings("constr").ConnectionString)
      Conn.Open()
      Dim cmd As New SqlCommand("ValidateEmpID", Conn)
      cmd.CommandType = CommandType.StoredProcedure
      cmd.Parameters.AddWithValue("@empID", txtEmpID.Text)
      Dim dr As SqlDataReader = cmd.ExecuteReader()
      If dr.HasRows Then
	  'Employee exists'
	  dr.Read()
	  checkusername.Visible = True
	  dprocessed.Visible = True
	  If dr("previousYear").ToString() = "1" Then
	      imgstatus.ImageUrl = "images/NotAvailable.jpg"
	      lblStatus.Text = "Please verify your information for accuracy. Then complete rest of the form."
	      lblStatus.ForeColor = System.Drawing.Color.Red
	      System.Threading.Thread.Sleep(300)
	      txteName.Text = dr("employeeName").ToString()
	      txttitle.Text = dr("empTitle").ToString()
	      txtemail.Text = dr("email").ToString()
	      txtEmpID.Text = dr("empID").ToString()
              
              fillSourceRecords() <--	      

	      'Dim currentRow As GridViewRow = CType((CType(sender, TextBox)).Parent.Parent.Parent.Parent, GridViewRow)
	     ' Dim txtsource As TextBox = CType(currentRow.FindControl("txtsourcename"), TextBox)
	      'txtsource.Text = dr("sourcename").ToString()
	     ' Dim txtsource As TextBox = CType(currentRow.FindControl("txtspousename"), TextBox)
	     ' txtspouse.Text = dr("spousename").ToString()                      

	  ElseIf dr("thisYear").ToString() = "1" Then
	      imgstatus.ImageUrl = "images/NotAvailable.jpg"
	      lblStatus.Text = "You have already completed this Disclosure form. Please close the form. If you feel there is a mistake, please contact Clerk at xxx-xxx-xxxx"
	      lblStatus.ForeColor = System.Drawing.Color.Red
	      System.Threading.Thread.Sleep(300)
	      txteName.Text = dr("employeeName").ToString()
	      txttitle.Text = dr("empTitle").ToString()
	      txtemail.Text = dr("email").ToString()
	      txtEmpID.Text = dr("empID").ToString()
	      txteName.Enabled = False
	      txttitle.Enabled = False
	      txtemail.Enabled = False
	      txtEmpID.Enabled = False
	      GridPanels.Enabled = False
	      dprocessed.Visible = True
	      btnNext.Enabled = False
	  Else
	      'not this year, nor the previous year'
	  End If
      Else
	  checkusername.Visible = True
	  dprocessed.Visible = True
	  imgstatus.ImageUrl = "images/Icon_Available.gif"
	  lblStatus.Text = "Proceed to complete entire form"
	  lblStatus.ForeColor = System.Drawing.Color.Red
	  System.Threading.Thread.Sleep(300)
	  txteName.Text = ""
	  txttitle.Text = ""
	  txtemail.Text = ""
      End If
  Else
      checkusername.Visible = False
  End If
End Sub


Notice that I commented out txtsource and txtspouse.

The point that is worth mentioning which was a problem is that when I enter empID to valid, even the it displays contents of the grid from the DB, the information display on the code below stays the same. It doesn't change to show that the employee, employee's title and email from code below is the same as the contents of the grid even they are all validated using the txtEmpID_TexChanged(...) method:

  <div class="table-responsive">
    <table class="table">
    <tr>
        <td>
        <div class="form-group">
        <label for="lblEname"><span style="font-weight:bold;font-size:16px;color:#000000;">Employee Name</span><span style="color:#ff0000">*</span></label>
         <asp:TextBox ID="txteName" placeholder="Employee name..." style="width:200px;" class="form-control" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator id="RequiredFieldValidator2" Font-Bold="true"
         SetFocusOnError="true" runat="server"
         ErrorMessage="*" ControlToValidate="txteName" /><br />
         </div>
         </td>
        <td>
         <div class="form-group">
        <label id="lblTitle"><span style="font-weight:bold;font-size:16px;color:#000000;">Your title</span><span style="color:#ff0000">*</span></label>
        <asp:TextBox ID="txttitle" placeholder="Employee title..." style="width:200px;" class="form-control" runat="server"></asp:TextBox>
       <asp:RequiredFieldValidator id="RequiredFieldValidator3" Font-Bold="true"
           SetFocusOnError="true" runat="server"
         ErrorMessage="*" ControlToValidate="txttitle" />
       </div>
       </td>
        <td>
         <div class="form-group">
         <label id="lblEmail"><span style="font-weight:bold;font-size:16px;color:#000000;">Your email address</span><span style="color:#ff0000">*</span></label>
        <asp:TextBox ID="txtemail" placeholder="Employee email..." style="width:200px;" class="form-control" runat="server"></asp:TextBox>
       <asp:RequiredFieldValidator id="RequiredFieldValidator4" Font-Bold="true"
        SetFocusOnError="true" runat="server"
        ErrorMessage="*" ControlToValidate="txtemail" />
        </div>
        </td>
    </tr>
   </table>
</div>


modified 30-Jan-20 11:27am.

GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
Richard Deeming30-Jan-20 4:53
mveRichard Deeming30-Jan-20 4:53 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
samflex30-Jan-20 5:14
Membersamflex30-Jan-20 5:14 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
samflex30-Jan-20 5:41
Membersamflex30-Jan-20 5:41 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
Richard Deeming30-Jan-20 5:47
mveRichard Deeming30-Jan-20 5:47 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
samflex30-Jan-20 6:45
Membersamflex30-Jan-20 6:45 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
Richard Deeming30-Jan-20 7:08
mveRichard Deeming30-Jan-20 7:08 
GeneralRe: Any ideas why gridview is not getting populated with data from the database? Pin
samflex30-Jan-20 8:11
Membersamflex30-Jan-20 8:11 
QuestionWriting a client app for OData Pin
simpledeveloper29-Jan-20 7:13
Membersimpledeveloper29-Jan-20 7:13 
QuestionDropdown Filtering in grideview vb.net Pin
Member 315525329-Jan-20 4:16
MemberMember 315525329-Jan-20 4:16 
QuestionFiles download fails for ipad and iphone clients Pin
alesanndro28-Jan-20 20:34
Memberalesanndro28-Jan-20 20:34 
AnswerRe: Files download fails for ipad and iphone clients Pin
Nathan Minier29-Jan-20 5:42
professionalNathan Minier29-Jan-20 5:42 
GeneralRe: Files download fails for ipad and iphone clients Pin
alesanndro29-Jan-20 6:51
Memberalesanndro29-Jan-20 6:51 
GeneralRe: Files download fails for ipad and iphone clients Pin
Nathan Minier29-Jan-20 9:28
professionalNathan Minier29-Jan-20 9:28 
GeneralRe: Files download fails for ipad and iphone clients Pin
alesanndro30-Jan-20 1:24
Memberalesanndro30-Jan-20 1:24 
GeneralRe: Files download fails for ipad and iphone clients Pin
Nathan Minier30-Jan-20 6:01
professionalNathan Minier30-Jan-20 6:01 
QuestionProcedure or function 'bla' expects parameter '@OrderNumber', which was not supplied. Pin
Johan Hakkesteegt27-Jan-20 21:50
MemberJohan Hakkesteegt27-Jan-20 21:50 
AnswerRe: Procedure or function 'bla' expects parameter '@OrderNumber', which was not supplied. Pin
F-ES Sitecore27-Jan-20 23:20
mveF-ES Sitecore27-Jan-20 23:20 

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.