Jump to content
Xtreme .Net Talk

shanekahkola

Members
  • Posts

    5
  • Joined

  • Last visited

About shanekahkola

  • Birthday 07/04/1974

Personal Information

  • Visual Studio .NET Version
    2005
  • .NET Preferred Language
    vb.net

Contact Details

  • Skype
    shanekahkola

shanekahkola's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. You rock! Thank you for the advice - it worked beautifully. I'm sure I'll have questions down the road, but that suits my needs. I hope I will be able to actually contribute as I get to know the .NET platform. Thanks again.
  2. I am struggling with the process of using an EXE app to access an XML source across the web. A game I play online offers the ability to access character information, item databases, etc. by using an online API. To my knowledge, here is how it works: The following URL should return an XML file that lists all of the characters on my account: http://api.eve-online.com/account/Characters.xml.aspx?userID=5050156&apiKey=13DC16F65B424DC4A9479C69A2DA9C1613A1D36EAA1F49A0B93380FAC6F55C69 Here is what I would like to do. I want to be able to receive that XML file and parse it into fields on a form. This is not ASP.NET, this is an executable with VB code pages. I have a form that requests the userID (7-digit number) and the apiKey (encrypted hash key). Here is my source code: Dim rPost As WebRequest = WebRequest.Create("http://api.eve-online.com/account/Characters.xml.aspx") Dim sData As String = "userID=" & txUserID.Text & "&apiKey=" & txLimitedAPI.Text rPost.Method = WebRequestMethods.Http.Post Dim rsGet As WebResponse = rPost.GetResponse 'rsGet = rPost.GetResponse Dim sr As New StreamReader(rsGet.GetResponseStream(), Encoding.ASCII) MsgBox("xml data", MsgBoxStyle.Information, sr.ReadToEnd) When I execute the code, I get the following error: The stack trace for the error is: I have created an account that will allow you to see what is supposed to happen. Here is the userID and the apiKey: userID: 5050156 apiKey: 13DC16F65B424DC4A9479C69A2DA9C1613A1D36EAA1F49A0B93380FAC6F55C69 My guess is that I'm just not using the WebRequest.Http.Post properly, but Microsoft's documentation doesn't cover this very well. Any help would be greatly appreciated.
  3. For background information on this particular post, please read my initial post and Mike55's response? I have done quite a bit of reading on ViewState and PostBack. I am having a difficult time processing everything I have read. I have decided to simplify a few questions and see if I can get some answers. Question 1: I have a DataGrid populated by SQLDataSource. PostBack is enabled in order to allow me to use the Grid's built-in sorting capabilities. Which is better? Remove the postback feature and script my own sorting or, leave the postback feature and use some other method for altering the data with searched criteria? Question 2: If I should leave postback enabled, what is the method I need to use to change the datagrid results so that the user can sort the new results instead of having the datagrid revert back to the original query? Quesiton 3: Am I just stupid and in need of giving up any attempts to program?
  4. I did like you said and put a conditional clause in for IsPostBack. I just had a message box pop-up for true and the query for false. For my own sanity, what are the drawbakcs of turning-off postback? If you prefer to post a couple of links that will send me in the right direction, that's just as good as you answering the question. Thank you for taking the time.
  5. I have searched the forums but, I can't seem to find anything that speaks to this: I have a GridView in my web app that retrieves data via a SQLDataSource. When the page opens, it automatically displays all data found in a particular table. I have three problems that I suspect are all related: Problem #1: I have a vb text box and button that allows the user to enter a phrase and click search. So far, that part is working pretty good. Below is the code that is executed when they click search: Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click Me.sqlArchive.SelectCommand = "SELECT * FROM ARCHIVEHOLDINGS WHERE CONTAINS(*,'" & Me.txSearch.Text & "') ORDER BY TITLE ASC" End Sub I get the desired effect where the grid's data changes to include only what matches the search text. However, when someone clicks on the header to sort the results, it goes back to the original query which is as follows: Me.sqlArchive.SelectCommand="SELECT * FORM ARCHIVEHOLDINGS ORDER BY TITLE ASC" Problem #2: If the search results return more than one page, clicking on the page you want to go to also reverts back to the original query. Problem #3: I have a button that allows the user to reset grid to the original query, or clear the query results. The code is as follows: Protected Sub btReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btReset.Click Dim sSortDir As String If Me.gvArchives.SortExpression <> "" Then If gvArchives.SortDirection = SortDirection.Ascending Then sSortDir = "ASC" Else sSortDir = "DESC" End If Me.sqlArchive.SelectCommand = "SELECT * FROM ARCHIVEHOLDINGS ORDER BY " & Me.gvArchives.SortExpression & " " & sSortDir Me.gvArchives.DataSourceID = "sqlArchive" Me.gvArchives.DataBind() Else Me.sqlArchive.SelectCommand = "SELECT * FROM ARCHIVEHOLDINGS ORDER BY Title ASC" Me.gvArchives.DataSourceID = "sqlArchive" Me.gvArchives.DataBind() End If Me.txSearch.Text = "" End Sub The above code sort of works. It causes the grid to return to its original state but, the paging on the bottom only matches the previous search query. What else do I need to post to give someone a good idea of what I am trying to do? Any help would be appreciated. Thank you.
×
×
  • Create New...