Click here to Skip to main content
15,908,834 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to bind checkedlistbox with dataset in vb.net (window application) Pin
Dave Kreskowiak24-Feb-09 3:51
mveDave Kreskowiak24-Feb-09 3:51 
QuestionUsing Reflection to on a Subclass as a Property Pin
nickbequick23-Feb-09 11:52
nickbequick23-Feb-09 11:52 
AnswerRe: Using Reflection to on a Subclass as a Property Pin
Dave Kreskowiak24-Feb-09 3:50
mveDave Kreskowiak24-Feb-09 3:50 
GeneralRe: Using Reflection to on a Subclass as a Property Pin
nickbequick24-Feb-09 4:01
nickbequick24-Feb-09 4:01 
GeneralRe: Using Reflection to on a Subclass as a Property Pin
Dave Kreskowiak24-Feb-09 6:17
mveDave Kreskowiak24-Feb-09 6:17 
QuestionProblems getting httpWebRequest to work Pin
rfrank535623-Feb-09 8:22
rfrank535623-Feb-09 8:22 
AnswerRe: Problems getting httpWebRequest to work Pin
Dave Kreskowiak24-Feb-09 3:43
mveDave Kreskowiak24-Feb-09 3:43 
GeneralRe: Problems getting httpWebRequest to work [modified] Pin
rfrank535624-Feb-09 10:21
rfrank535624-Feb-09 10:21 
HI - and thanks for the reply If you want to chat about this - call me at 510 889 1453

I Posted this reply a bit early - and have found a small glitch

I have modified the code a bit - here is the most recent version using a directcast . . . The other version hung on the response statement - forever - and the network is basically empty during the hang

The reply is a 1-4 byte string. ---> Glitch - the directcast returns the entire web page string -

I found the following as an alternate suggestion - it works - but seems to time out on each request (my test file has 2 records, and the total time is about 12 seconds) - but if I un-comment the test1 string I get sub second response to a browser window.

My DevEnv is VisualStudio2008



WebRequestString = "http://ws.geonames.org/gtopo30?lat=" & lineArray(LatPosition) & "&lng=" & lineArray(LonPosition)
'Dim test1 As String = "http://www.geonames.org/gtopo30?lat=33.7669399&lng=-116.4134417"



Dim Request As HttpWebRequest
Dim Response As HttpWebResponse
Dim reader As StreamReader
Dim sbSource As StringBuilder

Try

Request = DirectCast(WebRequest.Create(WebRequestString), HttpWebRequest)
Request.KeepAlive = False
response = DirectCast(Request.GetResponse(), HttpWebResponse)

If Request.HaveResponse = True AndAlso Not (response Is Nothing) Then

' Get the response stream
reader = New StreamReader(response.GetResponseStream())

' Read it into a StringBuilder
sbSource = New StringBuilder(reader.ReadToEnd())


End If

Catch wex As WebException
' This exception will be raised if the server didn't return 200 - OK
' Try to retrieve more information about the network error
If Not wex.Response Is Nothing Then
Dim errorResponse As HttpWebResponse = Nothing
Try
errorResponse = DirectCast(wex.Response, HttpWebResponse)
MsgBox("The server returned '{0}' with the status code {1} ({2Big Grin | :-D })." & errorResponse.StatusDescription & " , " & errorResponse.StatusCode & " , " & errorResponse.StatusCode)
Finally
If Not errorResponse Is Nothing Then errorResponse.Close()
End Try
End If

Finally
If Not Response Is Nothing Then Response.Close()

End Try
elevationvalue = sbSource.ToString

modified on Wednesday, February 25, 2009 10:31 AM

Question$$$ $$$ NEED VB BASIC HELP - WEB DATA EXTRACTION - NEED CODE !!! $$$ $$$ Pin
pcfacile23-Feb-09 7:49
pcfacile23-Feb-09 7:49 
AnswerRe: $$$ $$$ NEED VB BASIC HELP - WEB DATA EXTRACTION - NEED CODE !!! $$$ $$$ Pin
0x3c023-Feb-09 8:00
0x3c023-Feb-09 8:00 
AnswerRe: $$$ $$$ NEED VB BASIC HELP - WEB DATA EXTRACTION - NEED CODE !!! $$$ $$$ Pin
Mycroft Holmes23-Feb-09 15:57
professionalMycroft Holmes23-Feb-09 15:57 
QuestionHow to place the text at cursor position in vb.net textbox Pin
dilipmca0423-Feb-09 3:39
dilipmca0423-Feb-09 3:39 
AnswerRe: How to place the text at cursor position in vb.net textbox Pin
Dave Kreskowiak23-Feb-09 4:28
mveDave Kreskowiak23-Feb-09 4:28 
GeneralNew features in VB 10 Pin
Kevin McFarlane23-Feb-09 2:23
Kevin McFarlane23-Feb-09 2:23 
QuestionHow save a playlist in vb.net Pin
akosidandan23-Feb-09 2:03
akosidandan23-Feb-09 2:03 
AnswerRe: How save a playlist in vb.net Pin
Dave Kreskowiak23-Feb-09 4:27
mveDave Kreskowiak23-Feb-09 4:27 
QuestionEXCEL-How to trigger a function with the keyboard enter key Pin
Anoop Brijmohun23-Feb-09 2:01
Anoop Brijmohun23-Feb-09 2:01 
AnswerRe: EXCEL-How to trigger a function with the keyboard enter key Pin
Dave Kreskowiak23-Feb-09 4:26
mveDave Kreskowiak23-Feb-09 4:26 
Questioncould some one help me how save ms access database using vb 2008 Pin
akosidandan23-Feb-09 1:55
akosidandan23-Feb-09 1:55 
AnswerRe: could some one help me how save ms access database using vb 2008 Pin
Dave Kreskowiak23-Feb-09 4:17
mveDave Kreskowiak23-Feb-09 4:17 
QuestionEncrypt Stored Procedure Pin
trushitshah22-Feb-09 23:22
trushitshah22-Feb-09 23:22 
AnswerRe: Encrypt Stored Procedure Pin
Dave Kreskowiak23-Feb-09 4:14
mveDave Kreskowiak23-Feb-09 4:14 
Question"Sending SMS CMS ERROR: 301" [modified] Pin
scothyhut22-Feb-09 23:14
scothyhut22-Feb-09 23:14 
AnswerRe: "Sending SMS CMS ERROR: 301" Pin
Dave Kreskowiak23-Feb-09 4:13
mveDave Kreskowiak23-Feb-09 4:13 
QuestionHow to browse folder Pin
trushitshah22-Feb-09 22:33
trushitshah22-Feb-09 22:33 

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.