Click here to Skip to main content
15,899,475 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: I am still struggling to find a fix for this. Can some guru please help? Pin
samflex5-Dec-14 17:52
samflex5-Dec-14 17:52 
GeneralRe: I am still struggling to find a fix for this. Can some guru please help? Pin
jkirkerx5-Dec-14 18:11
professionaljkirkerx5-Dec-14 18:11 
GeneralRe: I am still struggling to find a fix for this. Can some guru please help? Pin
samflex6-Dec-14 3:47
samflex6-Dec-14 3:47 
GeneralRe: I am still struggling to find a fix for this. Can some guru please help? Pin
jkirkerx6-Dec-14 7:53
professionaljkirkerx6-Dec-14 7:53 
GeneralWorking copy of your code. Pin
jkirkerx6-Dec-14 9:00
professionaljkirkerx6-Dec-14 9:00 
GeneralRe: Working copy of your code. Pin
samflex6-Dec-14 14:47
samflex6-Dec-14 14:47 
GeneralRe: Working copy of your code. Pin
samflex6-Dec-14 16:21
samflex6-Dec-14 16:21 
QuestionAsp.net page with Web Service WITHIN code behind being called Pin
StealthRT4-Dec-14 5:13
StealthRT4-Dec-14 5:13 
I am trying to call a web service function within my own ASP.net (code behind) using AJAX on the page.

Once i push the button to execute the JS/AJAX/codebehind - I got an error.

[b]POST [url]http://************/admin/Admin.aspx/getDBInformation[/url] 500 (Internal Server Error)[/b]

This is my code below that I am currently using:
[code]
<webmethod> _
Public Shared Function getDBInformation() As String
loadDBData()
Return JsonConvert.SerializeObject(dbInfo, System.Xml.Formatting.Indented)
End Function
End Class
[/code]
The code behind looks like this:
[code]
Imports System.DirectoryServices
Imports System.Security.Principal
Imports System.Net
Imports System.Drawing
Imports System.IO
Imports System.Data.SqlClient
Imports System.Web.Services
Imports Newtonsoft.Json

Partial Class _Default
Inherits System.Web.UI.Page

Dim dbStoredData As dbData
Shared dbInfo As New List(Of dbData)

Dim sqlQ As SqlCommand = Nothing
Dim conn As SqlConnection = Nothing
Dim reader As SqlDataReader = Nothing
Dim strconnstring As String = ""
Shared theQuery As String = "Server=*******,1433;Database=**********;User Id=*******;Password=*********;"

Private Class dbData
Public veID As String = ""
Public veDate As String = ""
Public lastUpdated As String = ""
Public updatedBy As String = ""
End Class

[SOME MORE CODE BETWEEN HERE THAT WAS LEFT OUT]

Public Sub loadDBData()
conn = New System.Data.SqlClient.SqlConnection(strconnstring)
conn.Open()

theQuery = _
"SELECT * " & _
"FROM downTable " & _
"ORDER BY veID DESC"

sqlQ = New SqlCommand(theQuery, conn)
reader = sqlQ.ExecuteReader
dbInfo.Clear()

While reader.Read()
dbStoredData = New dbData()
dbStoredData.veID = EscapeLikeValue(reader("veID").ToString())
dbStoredData.veDate = EscapeLikeValue(reader("veDate").ToString())
dbStoredData.lastUpdated = EscapeLikeValue(reader("lastUpdated").ToString())
dbStoredData.updatedBy = EscapeLikeValue(reader("updatedBy").ToString())
dbInfo.Add(dbStoredData)
End While

sqlQ = Nothing
conn.Close()
conn = Nothing
End Sub

<webmethod> _
Public Shared Function getDBInformation() As String
loadDBData()
Return JsonConvert.SerializeObject(dbInfo, System.Xml.Formatting.Indented)
End Function
End Class
[/code]
How can I correct this issue so that I am able to cal
QuestionRe: Asp.net page with Web Service WITHIN code behind being called Pin
jkirkerx4-Dec-14 8:55
professionaljkirkerx4-Dec-14 8:55 
SuggestionRe: Asp.net page with Web Service WITHIN code behind being called Pin
ZurdoDev4-Dec-14 10:45
professionalZurdoDev4-Dec-14 10:45 
Question.NET System.OutOfMemoryException in View using DisplayTemplate Pin
G-Alonso30-Nov-14 1:39
G-Alonso30-Nov-14 1:39 
AnswerRe: .NET System.OutOfMemoryException in View using DisplayTemplate Pin
Matt U.4-Dec-14 4:43
Matt U.4-Dec-14 4:43 
QuestionDisplaying javascript values from one page to another using multiview Pin
samflex29-Nov-14 14:10
samflex29-Nov-14 14:10 
AnswerRe: Displaying javascript values from one page to another using multiview Pin
Anurag Gandhi30-Nov-14 22:41
professionalAnurag Gandhi30-Nov-14 22:41 
GeneralRe: Displaying javascript values from one page to another using multiview Pin
samflex1-Dec-14 5:54
samflex1-Dec-14 5:54 
Questioncan anyoen tell me when i use file upload in asp.net.how to rename file with id..its very urgent..plz Pin
Sanju Choudhary S28-Nov-14 2:13
Sanju Choudhary S28-Nov-14 2:13 
AnswerRe: can anyoen tell me when i use file upload in asp.net.how to rename file with id..its very urgent..plz Pin
den2k8828-Nov-14 2:38
professionalden2k8828-Nov-14 2:38 
AnswerRe: can anyoen tell me when i use file upload in asp.net.how to rename file with id..its very urgent..plz Pin
Richard Deeming28-Nov-14 2:43
mveRichard Deeming28-Nov-14 2:43 
GeneralRe: can anyoen tell me when i use file upload in asp.net.how to rename file with id..its very urgent..plz Pin
jaimin851-Dec-14 23:13
jaimin851-Dec-14 23:13 
GeneralRe: can anyoen tell me when i use file upload in asp.net.how to rename file with id..its very urgent..plz Pin
Richard Deeming2-Dec-14 2:23
mveRichard Deeming2-Dec-14 2:23 
QuestionJavascript Scanner recognition Pin
Member 1035398227-Nov-14 22:54
Member 1035398227-Nov-14 22:54 
AnswerRe: Javascript Scanner recognition Pin
ZurdoDev2-Dec-14 3:14
professionalZurdoDev2-Dec-14 3:14 
QuestionHashing fields pre server post Pin
Dale17727-Nov-14 14:09
Dale17727-Nov-14 14:09 
AnswerRe: Hashing fields pre server post Pin
Kornfeld Eliyahu Peter27-Nov-14 19:12
professionalKornfeld Eliyahu Peter27-Nov-14 19:12 
GeneralRe: Hashing fields pre server post Pin
Dale17727-Nov-14 20:24
Dale17727-Nov-14 20:24 

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.