|
Your web service is deployed on different environment like Deve, Test, Production, is this correct?
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
yes
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
Good, no need to reference the service for different environment, just change the URL of app.config file according to environment and your DLL will remain the same.
Like:
If you are going to deploy dev environment then your ULR will be in app.conf
http:
QA
http:
etc.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Thanks for reply Parwej,
I will give you example of scenario.
I have one solution file say SampleSolution in that I have one Business Layer say BLayer as project in solution and one website say SampleWebsite in same solution.
Now my web service is in Blayer Project. When I add web reference (i.e. web service) of testing environment in this project it creates reference in app.config file. Now when I add reference of this project in my website (i.e. SampleWebsite), DLL of this project (i.e. BLayer.ddl & BLayer.pdb) is add in my BIN folder. While deploying on testing server I will compile the website and publish it and copy these files (i.e. BLayer.ddl & BLayer.pdb) along with other files in website to my testing server. After clearing testing and moving to live server I have change the path of my web reference to live server and compile it (i.e. BLayer) again to deploy on live server again. This is what I don't want to do.
Is there any way to do it without compiling BLayer again
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
As long as if you do not modify(adding new function or updating existing function) web service , you can simply add reference in your live project once and can change the url on live server, no need to reference again and again.
hope u get this.
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
Hi,
can you please elaborate it?
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
But I have to compile file again for the project.
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
I got your point, move Web Service URL configuration from app.config to Web.Config and try to change URL according to your environment. Hope so this will work
Thanks,
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
To load web service in two different environment is need to change only service URL in web config in case of web site and in appsetting in case of window application.
if you want to load dll of the fly (scenario based)go for reflection.
code to load:
System.Reflection.Assembly o = System.Reflection.Assembly.Load("mscorlib.dll");
System.Console.WriteLine(o.GetName());
|
|
|
|
|
As I said I have web application.
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
I have an input text HTML control (not ASP.NET control) on an ASP.NET page in a content place holder. I am able to execute JavaScript functions from onfocus (to clear the control), and onkeyup (to verify data) events but not from an onchange event.
When the onchange event didn't give expected results I tried an onclick event, and an alert to show the event fired, to verify the JavaScript function was coded correctly and the function operated as expected.
Does anyone know why these other events fire but the onchange event does not fire?
<reason>
Strange as it seems the onchange event was not firing because I also had an onkeyup event on the control. If I remove the onkeyup event the onchange event fires. When I add the onkeyup event back in the onchange event doesn't fire.
Thanks ASP.NET!
Since I need the onkeyup event for verifying only selective keystrokes are accepted I am left with the task of making an onpropertychange event, which fires on every keystroke, mimic the behavior of the onchange event which only gets fired if the content changed and the focus has moved away from the control.
I cannot use the onblur event because one of the fields presents a calendar control which when displayed fires the onblur event. I have a 98% solution now but it doesn't work for some pretty obscure fringe cases.
I will still have to keep working on this to get to a 100% solution.
</reason>
|
|
|
|
|
onchange event fires only when you changed the text and then lost the focus from the textbox.
It will not fire every time you press the key. It will fire only once, for text change in the textbox, after loosing focus.
If you wish to handle event as soon as user types, use on KeyPress event instead.
Hope this will help.
|
|
|
|
|
Anurag Gandhi wrote: onchange event fires only when you changed the text and then lost the focus from the textbox.
Yes that is the expected behavior but it is not happening.
|
|
|
|
|
Hi,
I am working on the C#/.NET application where in i need to get Current Identity value of the table using LINQ. Or else I can use the sql query to get the task done by either using
var num = DataContext.ExecuteCommand("Select IDENT_CURRENT ('table')");
By using this above code, i am getting the value = -1.
or
var num = DataContext.ExecuteQuery(("Select IDENT_CURRENT ('table')");
By using the above code, i am getting an exception "Specified cast is not valid." and the value remains NULL.
Correct me if i am doing something wrong. let me know if there are any better ways to do this task.
Thanks for ur help in advance.
|
|
|
|
|
Are you inserting data through Linq with SP OR adding object?
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
I am not inserting any data. I just want to have the Current Identity value of the table. so that i can make use of it for displaying it to the user.
|
|
|
|
|
I think you can use max id of Table.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Thanks for the answer.............but
i have a scenario where Lets say presently last column id value is 30, but there were 4 records after Column id = 30. but now they are deleted from the table. so i need to the column id value = 34 when i execute the query for the Current Identity value but not the value = 30.when i use max(id) i get 30 which is not what i am looking for.
|
|
|
|
|
The value returned from ExecuteCommand is the number of records modified by the command (in your case, you are not modifying records). See here. You probably want ExecuteQuery.
EDIT: I see you are using ExecuteQuery in your second example. I didn't notice that, as I was ignoring that line due to the syntax error you have there (extra paren).
Driven to the ARMs by x86.
|
|
|
|
|
See the documentation for ExecuteQuery. It will return a collection, not an individual number. You should also be specifying the return type. Get the first item from the collection and you should be good to go.
Driven to the ARMs by x86.
|
|
|
|
|
You could also try "SELECT @@IDENTITY"
But what you've got is already correct (for SQL 2005, at least), so it may be a LINQ problem, not a database problem (and certainly nothing to do with asp.net).
You might have better luck in the LINQ forum.
EDIT: Ah. You already moved there.
|
|
|
|
|
Hi
I have a situation where i need to upload many files at a time. The number of files can be any thing like 1, 100, 144, 1000, or 500 or any number. a user will come he will select a folder the uploader should loop the folder and upload every file that is present in the folder. Does there lie a solution to this problem in asp.net.
|
|
|
|
|
S_Aijaz1 wrote: a user will come he will select a folder the uploader should loop the folder and
upload every file
I don't think this is possible directly with asp.net. Security issue in web.
However, you can achieve this using Flash, silverlight or ActiveX in your web application.
I would suggest, search solution(s) in those area.
|
|
|
|
|
what security issues are there?
|
|
|
|
|
I would not allow any browser to read my hard drive(s)/Folder and send the file information to the server.
It is ok for me to upload the selected file based on need AND with my permission. But if anything is getting uploaded, i should be properly aware of them.
Please note and every user is not a developer and they may or may not be aware of what your site is doing.
I hope this answers your question. If not, you may google it. A lot of thread has already discussed on "File Upload security issue".
|
|
|
|