|
Hi all
Noob question
I'm using different web services depending on whether I want to connect to the development back end server or the production one. I'd like to choose which web service to use based on a setting in the web.config file. If I use a case statement (or if etc) to define my object the code complains that the object isn't declared.
e.g.
if Appsettings("Debug") = "True" then
dim myObj as new devServer.Service
else
dim myObj as new prodServer.Service
end if
myVar = myObj.somethingClever
name myobj is not declared
Can this be done in some other way?
Thanks
Dave
|
|
|
|
|
Your issue is that myObj exists within the scope of the if statements. Set myVar to be the right service within the code block, or define myObj outside it, so that it's visible outside of the scope of the if statement.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
Sure, I understand why the example doesn't work. For this trivial example it would be easy enough to define myVar within the code block. However, my question is whether there's another way of approaching this problem.
Dave
|
|
|
|
|
It depends. I would probably put the two web services inside a single property that returns the right one based on the version, so I only do the check in one place. Beyond that, I don't see any better way to do it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
We took a different route. When the user logs on they choose the server they want to work against. Typically they may have production, and 2-3 analysis servers they want to connect to. Additionally they can connect to UAT and dev servers by choice.
So we pass in the server name from the UI. Caveat - all the servers must use the same credentials. We do have a different set of creds per application.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Interesting. But how are you actually using the server name in the code? The problem I can't get my head around is how to do this without explicitly using the server when I define my objects.
|
|
|
|
|
Different development paradigm - all my objects are late bound. So during development the form objects are placed and named using a standard convention. A class is created to supply the CRUD and any other processing for each table.
At runtime the class gets the table via the DAL and a utility binds the 1 row to the form elements or dumps the table into a datagridview.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
This is for a Windows Application, not a Web. Anyways I have a Datagrid and I'm setting it's datasource to a table in the database i'm using. If in that table there is a column thats numeric, if i change that numeric column in the datagrid and i enter a non-numeric value and lose focus, the datagrid will catch this on it's own and display a message automatically. But i need to catch this when i click the save button so i can catch all errors at once and display in a single meessage.
If there is any way to disable this or trick the datagrid could someone please let me in on it, because i've been searching for a while and had no luck finding anything.
|
|
|
|
|
Change the numeric field to text and validate on save!
You lose any numeric settings for the column but it won't error
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i have a window service that will alert until a file is read
the ftp write the code below to a log file where sent signify the file has be read
can someone help me with a subroutine in vb .ne that will return boolean indicating whether the file has be read or not
#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2008-06-10 09:04:08
#Fields: time c-ip cs-method cs-uri-stem sc-status
09:04:08 192.168.114.55 [1]USER anonymous 331
09:04:08 192.168.114.55 [1]PASS IEUser@ 230
09:04:16 192.168.114.55 [2]USER anonymous 331
09:04:16 192.168.114.55 [2]PASS IEUser@ 230
09:04:17 192.168.114.55 [3]USER anonymous 331
09:04:17 192.168.114.55 [3]PASS IEUser@ 230
09:04:17 192.168.114.55 [4]USER anonymous 331
09:04:17 192.168.114.55 [4]PASS IEUser@ 230
09:04:42 192.168.114.55 [3]created MS+Pricelist.xls 226
09:14:25 192.168.114.55 [5]USER anonymous 331
09:14:25 192.168.114.55 [5]PASS IEUser@ 230
09:14:25 192.168.114.55 [5]sent /MS+Pricelist.xls 226
09:14:30 192.168.114.55 [5]sent /MS+Pricelist.xls 226
09:19:47 192.168.114.55 [6]USER anonymous 331
09:19:47 192.168.114.55 [6]PASS IEUser@ 230
09:19:47 192.168.114.55 [7]USER anonymous 331
09:19:47 192.168.114.55 [7]PASS IEUser@ 230
09:19:47 192.168.114.55 [7]sent /MS+Pricelist.xls 226
09:19:47 192.168.114.55 [7]sent /MS+Pricelist.xls 226
09:19:47 192.168.114.55 [8]USER anonymous 331
09:19:47 192.168.114.55 [8]PASS IEUser@ 230
09:23:23 192.168.114.55 [9]USER anonymous 331
|
|
|
|
|
About the only thing that comes to mind is to check the System.IO.File.GetLastAccessTime, but quite what you want to do with it is up to you.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
am using ftp
just look at the file give me idea on how to get the sent if you know about log files
|
|
|
|
|
Ok, I misunderstood your question. All you need to do is read the log file, look for "sent" in the row and get the file name.
If you post your code I will be able to see where you are going wrong.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I am reading rss feed using webrequest class object and showing its title in my application.
Can we have something that gives whether that particular feed is changed/updated at particular datetime so that I can update my application's data/content.
Rite now I am comparing string value of previous one and the one which is fetched on particular instance of time. This will use my bandwidth even if that feed is not updated !!!
Thanks,
regards,
divyesh
|
|
|
|
|
You need to have a look at the rss feed. They mostly have a date stamp of some kind, but how are you going to know if it has updated without fetching it to check anyway?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: but how are you going to know if it has updated without fetching it to check anyway?
magic
Telepathic software - my favourite.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I had an error in a program I was working on. A dialog box came up saying
"do you want to view Disassembly?" I clicked OK just for the fun of it, and
now every time I run the program it opens a new tab in VB.NET titled
Disassembly.
My guess is I checked an option to view the disassembly every time.
However, I really don't want this to happen!
Does anybody know how to turn this off again?
monika
|
|
|
|
|
Hi,
In the Tools Menu, click on Options tab. In the Debugging properties on the left pane, you can see there is a check box on the right side, describing 'Enable address-level debugging'. Under that there is another check box with the description 'Show disassembly if source code is not available'. Uncheck the same if you have checked it and try again.
Meeram395
|
|
|
|
|
Hiii Monika
I am also facing same problem. I solved by the following sequences
In the VB.Net 2005 Editor
Select Tool Menu ---> Options --> In the Dialog Box Select Show All Settings Check Box Then Explorer Debugging---> Then De select the "Show disassembly if source is not available."
And then click ok
I hope this code solve your problem
Thanx
Mitesh Khatri
khatrimitesh@hotmail.com
|
|
|
|
|
I have made application in the past using VBA & Microsoft access. A couple road blocks exist - 1 is not enough capabilities to do graphic stuff, including having a circular or many sided shape in a form (similar to the rectangle)
I am thinking of making another application but need:
future support (I feel VBA is dying out)
strong database features (VBA access was great)
better graphic support - ie circular shapes with properties (not a pic of a circle - need to select just a circle because it may need to be tangent to a line etc)
IS >NET for me - is it similar in many ways? expensive?
Thank you very much in advance!!!!!
|
|
|
|
|
rypstra wrote: future support (I feel VBA is dying out)
I'd have said it was dead
rypstra wrote: IS >NET for me
It will definately do what you want
rypstra wrote: is it similar in many ways?
If you mean VB.NET, then perhaps a little. Not a whole lot tho, I don't think
rypstra wrote: expensive
VB.NET express edition is free.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I have one application in vb.net.
One problem is when i debug my application,cursor goes to every stattment and show assembly language also.
how can i off assembly language debugging?
pls help me
Thanks
monika
|
|
|
|
|
Just don't step into stuff you don't have source code for.
And, it is NOT assembler. It's MSIL.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
I am not getting yr point.how is it possible my source code is not available?
if this possible,what's the solution?
pls help me
Thanks
monika
|
|
|
|
|
his point is pretty clear. I got it and had replied. What was the point in you replying to say you didn't understand his question, when I had answered it ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|