|
Hi THere, as the subject says, I'm writing a webservice and would like to connect to a database.
[WebMethod]
public ClientData[] GetClientData(int Number){
}
I'm not sure how to connect. Can someone please let me know the steps required to connect to a Remote database?
Thanks
|
|
|
|
|
It is just like connecting to a remote database from your application means in the connection string you have to give the database systemname on which system it is deployed ,like its systemname or IP address.
For example in ur connection string u have provide the parametres like
Sqlconnection _connetcion=new sqlconnection("Server=SystemName;Initial Catalog=DatabaseName;User Id=sa; Password=;")
I hope this will works for you.
More over give this connection strings in your web.config file so that you can refer it all over the function and mainatainace will be easier if your database is moved to other systems in the future.
Sorry for my poor english
Happy programming.
Cheers,
|
|
|
|
|
Connecting to a database from a web service shouldn't be any different than a regular app.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
I HAVE DISABLED CTRL ALT DEL COMBINATION BUT I HAVENT FOUND SOLUTION TO DISABLE AL+F4. If any one guide me i shall be thankful to him.
tahir
|
|
|
|
|
HAVE YOU TRIED OVERRIDING WNDPROC?
Don't use caps lock, it makes you look foolish, well except to highlight one or two words, but not a sentence.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
The Undefeated wrote: Don't use caps lock, it makes you look foolish
Thank you.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
tahir_makhdoom wrote: I HAVE DISABLED CTRL ALT DEL COMBINATION BUT I HAVENT FOUND SOLUTION TO DISABLE AL+F4.
No all caps, it is considered rude. Like the other poster said, you are going to have to hook into the keyboard.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
Would you use a program that disables stuff like that? I wouldn't.
|
|
|
|
|
Hi,
First post here. I would like to develop an application so that the users can run it from a server by using a web browser. I have heard that C# might be suitable for this.
Does anyone now any good books that treats this subject? Or perhaps good web-sites??
Thanks!
/Kristian
|
|
|
|
|
there's many books that is a good one.
Beginning ASP.NET 2.0 with C Sharp 2006
Wrox
Assaf
|
|
|
|
|
xkrja wrote: Or perhaps good web-sites?
You are at one of them...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi
In my application I need that "When user enters a value in the textbox there should be a validation routiene which contains some formula, execute that and should return the entered value is correct or not and this validation routiene should be changeble by the user".
i.e. validation routiene is like plug-in in C#.net windows application.
Please help me
Thanks in Advance
Praveen Kumar Palla
|
|
|
|
|
Please be a bit more specific so people can possibly help you.
"I really like comments where I don't have to answer stupid questions" - stfx
|
|
|
|
|
i created a dataset by code and one by wizad.
I assign data to the one created by code, can I assign the same data to the one created by wizard
Using the code.
Thanks i advance
Assaf
|
|
|
|
|
That's great. Keep up the good work - especially filling the dataset by code as you don't want to be using the wizards too much.
|
|
|
|
|
Assaf82 wrote: Using the code.
Very good. You can assign it to the one in the wizard, but for future reference, try not to use the wizard.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
if i don't want to use the wizard how i can let the crystal Report see this dataset?
i need to do a report a the end
Thanks for help
Assaf
|
|
|
|
|
how i can assign it ???
Thanks a lot
Assaf
|
|
|
|
|
Hi,
I have a form which should work like a custom directory browser.
The form has a TreeView & ListView (like a windows explorer).
I managed to browse trough the TreeView.
But I also want to Activate files in the ListView.
Anyone an idea how to do this?
|
|
|
|
|
Hi!
What do you mean by "Activate files in the ListView"?
Entries in the ListView can be highlighted/activated by setting the Selected property of the corresponding ListViewItem to true, but I guess you mean something different.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
If i browse to a directory which has files....I want to be able to run these files with their related software by doubleclicking in listview.....e.g. an AutoCAD file: drawing.dwg (isn't that ItemActivate?)
|
|
|
|
|
ItemActivate is an event the ListView provides - it's up to you what to do once this event is fired.
You can use the Process class to run applications and if you give a non-executable file to run (e.g. Process.Start(@"C:\Temp\mytext.txt"); ), the default application for this type of document is started
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I my case I only have to run files with their associated applications. So the code must provide the option to run all kind of files with extensions like: *.txt, *.jpg *.dwg, *.xls etc....I think about 10 types of files....a part of my code is like you mentioned to run files:
private void ListView1_ItemActivate(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
string sPath = TreeView1.SelectedNode.FullPath;<br />
string sFileName = ListView1.FocusedItem.Text;<br />
<br />
Process.Start(sPath + "\\" + sFileName);<br />
}<br />
catch (Exception Exc) { MessageBox.Show(Exc.ToString()); } <br />
}<br />
private void ProjectWindow_Load(object sender, EventArgs e)<br />
{<br />
this.ListView1.ItemActivate += new System.EventHandler this.ListView1_ItemActivate);<br />
}
But this code gives an error that the sytem cannot find the file when i double click it.
The code is split up in 2 parts...the path & the file. I think it can't find the fullpath of the SelectedNode....but there must be a SelectedNode otherwise i cannot see the file in the ListView??
What am i doing wrong?
|
|
|
|
|
Start a debugger and try to find it out
Put a breakpoint to your Process.Start() instruction and check sPath and sFileName.
Oh, and are you sure you want to use ListView1.FocusedItem instead of ListView1.SelectedItems[0] ?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I managed to run files....I placed a MessageBox to check what the path
was of the SelectedNode....It turned out not to be the Full Path but a Folder in the tree.
So I added also the string of the rootpath to that Folder....
Anyway it is running files now....however only known filetypes....when a filetype is not associated to a program by windows I get an error...is it difficult to solve that?
also folders are listed in the ListView.....when I double click them....an external explorer window of the selected item is opened outside my application....but the ListView should work like an explorer too....so it must browse when a folder is double clicked and it should run when a file is selected...
What is the difference between:
ListView1.FocusedItem and ListView1.SelectedItems[0] ?
Thanx for helping me out sofar....I am a beginner in programming.
-- modified at 6:33 Tuesday 30th October, 2007
|
|
|
|