Jump to content
Xtreme .Net Talk

VBAHole22

Avatar/Signature
  • Posts

    433
  • Joined

  • Last visited

About VBAHole22

  • Birthday April 22

Personal Information

  • Occupation
    Hack Programmer
  • Visual Studio .NET Version
    VS.NET2003
  • .NET Preferred Language
    C#

VBAHole22's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I believe that when you add the web ref that way in studio it actually dumps something in the web.config file with the url. But i don't know if something gets compiled as well which would mean that you could not redirect the url after you have deployed. I have also experienced times when the web ref seems to have been 'lost'. Also don't forget that you need to refresh it if you change the web method code. I think when you set the ref through studio alot of things happen so i would stick with that way of doing it. You want that proxy to be created for you, it gives you intellinonsense when working with the web service.
  2. I'm getting ready to write a web service layer for an asp.net 2.0 application and i wanted to get opinions on particular aspects of how to go about this the best way specifically: parameter format and response format. Currently all of the clients that call my web service tier will be browsers, but i can foresee in the future where win apps might hit it as well. In the past I have used a single xml request parameter that was a string and contained all of the elements and attributes to describe the input params. I liked this because I could parse the single xml param when it came in and quickly determine if the attributes (the true params) were bogus so I could reject the call quickly. I found that this kind of request was a little tougher to formulate in the browser through javascript (for ajax). but if the client were a win app it would be trivial. The other approach i have used is to just leave the params in the web service call and use query string to pass them along. This is fairly easy to setup in javascript (i typically make all params strings). Now for the response. I have done xml and json in the past. Sometimes my response is large so i like json for compaction. But json requires more knowledge of the object being passed within the javascript. I would like to have the response be a consistent package deal - for example, a call to any web service method returns 3 things: a success/failure flag, a status message, and the method-specific results. This seemed tough to get working in json. Any suggestions before I push off on this voyage? Does AJAX.NET change the issues within this equation.
  3. I have an Oracle stored proc that fills a DataTable that I then bind to an ASP.NET 2.0 GridView control. This GridView is in an AJAX.NET update panel and I want it to have paging. It also has a button field. When a user clicks the button it flips a checkbox in the same row. If i page I lose the checked boxes. I want to be able to page, maintain the edits the user is making, and then when they mash a button when they are ready, send the edits myself over to oracle. Can't seem to get it done. If i ditch the paging it's a little easier. As the gridview is being bound I create a dataset in view state. When the use mashes the button I loop over the recs in the gridview and compare the state in the check box with the original for that rec. If there is a difference I act on it. This system falls apart when you page because you can't compare with row index to find the delta. I don't mind not having paging but the problem then is that the Ajax.net update progress panel is no longer visible when you scroll down. There is a js script out there to move the div that they progress panel is in but it won't move down past 800px. If I can use a DataTable to bind to a GridView why can I not get the changes back into the DataTable? I should just be notified of the diffs, even with paging. What am I missing?
  4. A little more information that I gathered from searching. There is a RowState property on all rows in a DataTable that will tell me if the row has been modified and will give me the original and modified values which is exactly what I need. But I can't get at my GridView's data source which I know is a DataTable. gv.DataSource = myDt; //will bind my grid //but after postback DataTable dt = gv.DataSource as DataTable //only returns null //i do have viewstate enabled because I can get at foreach (GridViewRow gvr in gv.Rows) { DataControlRowState drs = gvr.RowState; } But the DataControlRowState is not the same as the RowState on a DataRow and it doesn't have the same capabilities. How can I get my dataTable back from the source of the gridView with the user changes?
  5. I have a gridview that I fill by binding it to a dataTable. Then I let the user make modifications to check boxes in the grid. When they are done they click a button and I need to run some stored procs for the changes they made. Is there a simple way for the DataTable to tell me which rows have been modified? I know this is what a diffGram is supposed to do. My data is not coming from xml and I don't want ADO.NET taking care of anything more than just telling me what changed. I'm reading alot about how .NET can run and update my data for me and such. I'm not ready to give that control over yet. Any suggestions?
  6. I suppose that would work. In that case though I would not even need the app.config file because I would be hard-coding the network location of the true config file. Based on what I have read if you deploy a ClickOnce app you cannot edit the app.config (even if you can find it) because it is hashed and checked.
  7. Humm... The way i have it now I do get appname.exe.config and i can read/write to it from my app. The user can also navigate to the file and read/write to it. I'd like for my clients to be able to have a single version of this config file on the network for all users to read from so a change can be pushed to all of them. Looks like ClickOnce falls on it's face on this one based on some googling about it.
  8. I want to have an xml config file that users can modify if they need to and my windows form application can access while running so that it too can read/write to the file. So I added an app.config file and set to work. It works fine for what I need but when I do a ClickOnce deploy that xml file is not visible or accesible to the user anywhere. How can I have the user and machine read/write config file and use ClickOnce together?
  9. I have an AJAX.NET enabled page that allows a user to do some searching of a db and some other functionality. One of the functions is long running and takes about 2 minutes sometimes. I keep getting Web timeout messages to the browser. I would like this process to run its course and just let the user do what they want while its running. Do I have to turn it into a web service so that it can run asynch?
  10. I have an asp.net Atlas enabled 2.0 website that has a gridview control in it to bind results from a query I make. The problem is that I'm tyring to bind it to a DataSet that has multiple DataTables with results in it. Only the first DataTable is bound so that: myGridView.DataSource = myDataSet; myGridView.DataBind(); is the functional equivalent of myGridView.DataSource = myDataSet.Tables[0]; myGridView.DataBind(); Is there a way to bind all the tables? Or should I be looking at a better control for this. I can dynamically add a new gridView for each Table but I want something a little more visually pleasing. Each of the Tables has different columns so there is only so much I can do I suppose.
  11. I'll give that dictioinary a shot. The problem with the Contains, as far as i can tell, is that it is comparing objects so if i make a new object there is no way its going to be 'equal' to an object in the collection already right? The only way that the objects would be equal references would be if i pulled it out of there in the first place wouldn't it?
  12. I have a class that has 4 properties, one of which is a string. I make a collection of these class objects like so: List<MyObject> myObjects = new List<MyObject>(); I then start throwing new objects in the collection: MyObject m = new MyObject(); m.name = "yatta"; m.id = 12; m.isBig = true; m.dbl = 12.5; myObjects.Add(m); My question is: how can I find out if there is already an object in the collection that has one of the properties at a specific value so I don't add it again? For example if my next object had a name of "yatta" I would not want to add it again. But how can I find out if it is already in there? I know that I can do the following but it seems clunky: bool foundOne = false; forech (MyObject i in myObjects) { if (i.name = m.name) { foundOne = true; } } There has to be a better way that I can do this where the code for it would be in my class and not in my program code.
  13. It just so happens that i do have a reason to fix up my code. And i greatly appreciate the predicate sample code - couldn't come across that on Google. What happened was I wrote my Equals override to test if the name prop was the same between my test case and my collection. But then I got to a point where the comparison needed to be on the Name and Whatever props. So I can't re-write the Equals to have it work for both cases. I don't have a solution yet for this. Seems like I need to pass in a param to tell my compare (or equals) method what exactly I want compared. The hack I came up with was to just create my own method for each kind of comparison so that the things you are comparing are actually in the name of the method so I have a method for CompareName and CompareWhatever and they behave differently. Being the experienced programmer that i am I can sniff out (and mastermind) a giant hack from around the corner. There has to be a better way but it does boil down to the fact that the comparing method needs to know what to compare. Any ideas? Seems like this is what delegates are made for but i'm a little lost in that area. And I greatly appreciate the support.
  14. Cool. Va keepin' it real. I am going to try what you suggest but in the meantime I think this is working: public override bool Equals(object obj) { if (obj == null) return false; //1if the obj passed in is null it can't be equal to anything if (Object.ReferenceEquals(this, obj)) return true;//2if the object passed in is the same instance then its equal if (this.GetType() != obj.GetType()) return false; //3if the objects aren't the same type they can't be equal Node n = obj as Node; if (n == null) return false;//if the cast failed it ain't equal this might be the same as 3 if (nodeID.Equals(n.nodeID)) return true; return false; } public override int GetHashCode() { return nodeID.GetHashCode(); }
  15. I have an object called Node that has 3 properties. I create a List generic to hold a bunch of these node objects. Then I want to loop over a different collection of nodes and find out if they exist in the first collection mentioned above. How can I go about that? I know there is an IndexOf method on the List object but I think that is to find the same instance of a node (which in my case would never return true). I see that there are Find methods that take predicates but I am not testing to see if the node matches some pattern, I just want to see if my node is in the List collection. I would imagine that i have to override Equals or Compare because I figure there is no way .NET is going to know which of the 3 properties I want to compare. It turns out that I only want to compare one of the props and not all. Any code suggestions?
×
×
  • Create New...