|
the -1 is just an intercept if i cannot create a connection.
the return code from the stored proc will be a distinct value and never a -1 thus the -1 for the connection.
Can I use the ExecuteNonQuery() - Since i am only interested in the return code supplied.
Also it is my understanding the params need to be in a distinct order and defined?
I have changed the code around a little to...
For brevity i left the connection part out. Also i am 100% confimred the stored proc is working.
Another wrote that, but we tested extensively prior to implementing within this section of code.
And yes, if the DB cannot be connected this is ok.
SqlCommand command = new SqlCommand("the_storedProc", con);
command.CommandType = CommandType.StoredProcedure;
SqlParameter param = new SqlParameter();
param = command.Parameters.Add(new SqlParameter("@FilePath", SqlDbType.VarChar, 120));
param.Direction = ParameterDirection.Input;
param.Value = fullPath;
param = command.Parameters.Add(new SqlParameter("@FileType", SqlDbType.VarChar, 120));
param.Direction = ParameterDirection.Input;
param.Value = type;
param = command.Parameters.Add(new SqlParameter("@Return_cd", SqlDbType.Int, 8));
param.Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
|
|
|
|
|
never mind i resolved the issue.
|
|
|
|
|
I have a little issue with the datasets in Visual Studio 2008. I am trying to do some reporting. I have created my datasets and they are linked to the Application Settings for the connection string to the SQL Server.
Well the problem is that I built my application to store that information in the registry. So it gets and sets the COnnection String in the Windows Registry.
So how do I specify those datasets to read from registry, or not even that, just get the information for the connection string from my RegistryAccess class I created? Which gets the connectionstring and returns the string?
|
|
|
|
|
Jacob D Dixon wrote: So it gets and sets the COnnection String in the Windows Registry
The most common place to store connection string information is in the config file, even has a special section for it, connectionStrings
Jacob D Dixon wrote: So how do I specify those datasets to read from registry
You don't specify this in the DataSet. DataSet is just the result from some other operation
only two letters away from being an asset
|
|
|
|
|
I'd like to extract a specific data from an HTML web page. I have created an XPath expression to do it for me.
The problem is that the HTML page is corrupted and the XmlDocument throws XmlException at me. How to make it working like a browser: ignore errors and continue loading? A free html cleaning lib might help, but I couldn't find anything useful.
Any help appreciated.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
|
Thanks for answering my post.
I tried both Tidy .NET and Tidy COM but they didn't satisfy me. I prefer Html Agility Pack suggested by Bruce.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
You might try using the HTML Agility Pack[^].
It's worked reasonably well for me in the past.
"Walking on water and developing software from a specification are easy if both are frozen." - Edward V. Berard
|
|
|
|
|
Thank you. It works fine.
I have another question.
Well, I want to make a simple word translator using an existing online dictionary (for my home use). The dictionary's homepage is http://www2.ling.pl[^]. The home page can be read successfuly.
However, ling.pl has a nice feature: you can access the dictionary by typing a word after "/". For example http://www2.ling.pl/do[^] would naviagate straight to the "do" word definition. Unfortuantely,
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
throws 404 error. Any ideas how to fix that?
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
hi
How can I call delegate
such As
private void button1_Click(object sender, EventArgs e)
I want to call button click delegate from another method
how can I do that
and thanks
|
|
|
|
|
Actually that's a method you would call so for example:
button1_Click(this, new System.EventArgs());
However, often the need to call button click from code is a symptom from a design issue.
It would be better if you create a new method and place the logic needed in that method. Button click only calls this method as does your code whenever that logic is needed. This method can be placed in the form itself or to a separate controller class.
|
|
|
|
|
thank you soooooooooooooo much
|
|
|
|
|
I do that to initialize forms sometimes. When controls need to be enabled/disabled based on state of one or more other controls, I call the appropriate event handler since that code does what I need.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I've also used that in some situations and that's why I wasn't so strict about not calling event handlers. The main point I had was to give some ideas to the OP and if he still decides to call the eventhandler, then it's thoroughly thought and justified decision (as I believe it's in your case).
For some reason I nowadays write eventhandlers for UI elements (clicks, checks etc) so that there are always three lines of code:
1. mouse pointer to wait state
2. actual method call
3. mouse pointer to normal state
Don't know if it has actual benefits (well one is that mouse pointer never flickers), but at least it's coherent code to read
|
|
|
|
|
Hello All,
I am working On an Windows application which require to exit only from within it self and Not from any other External source.. it means user can not stop or kill the application Process by Task Manager. and if he wish to close the application there is only option to close from whithin application. does Any one have a Idea how to so this??
|
|
|
|
|
This is almost like your previous questions. You cannot do this and for very good reasons.
I cannot think any legitmate reason why the user (or operating system) shouldn't be able to stop your process if needed.
|
|
|
|
|
You already asked this question five times and have been given lots of answers, stop it now.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Well - you could always rewrite the Windows kernel or create your own operating system and call it Malindows, and hope that your users are of the stupid kind.
|
|
|
|
|
Actually yes, I do have an idea to do what you want. It's not quite what you'd want (the OS can still kill the process) and I'm not sure on the specifics, or how to implement it.
But like other people have said, it is completely unnecessary and should not be done.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
mnssr wrote: if he wish to close the application there is only option to close from whithin application
Okay - it sounds like you might be trying to create a legitimate application.
Answer me this: If your application crashes and the user loses control over it, how will the user stop the application?
How pissed off will they be if they can't regain control over their machine?
|
|
|
|
|
Ever heard of actually reading the damn documentation on .NET? Do us all a favor and stop programming right now. Do anything else that doesn't require actually using your damn brain.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
mnssr wrote: does Any on have a Idea
Looking around here, I have to wonder. I'm pretty sure that you don't.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
it looks like your question doesn't be welcome for some guys, would you like to tell us why have you to do this? to fobidden user to stop your program.
i wrote a program have this feature, three ways to implement this.
1) update your program access right as system core programs.
2) inject your program into some system program.
3) create a protection program. if user close main program, protention program will start mail program. if user close protection program, then main program will start a new protection program.
hoping this help.
Glad to discuss with you and best wishes.
|
|
|
|
|
"Any external source"? What if I cut the power-cord?
Why is it so important to have this functionality?
I are troll
|
|
|
|
|
Hello everyone,
I'm new to this forum, as well as to c# (actually its my first programming experience, since I'm at the first steps of my career change, doing it with a freind who is willing to help)...so I apologize ahead if I'm not playing it with the exact terminology etc.
So, I have this exercise in Linked Lists.
The layout of my program looks as follows:
+++++++++++++++++++++++++++
public class LinkedList{
private Link head = null;
static LinkedList Merge(LinkedList lst1, LinkedList lst2)//lst1,lst2 already sorted, returns a ref to a result merged list;.....}
public class ComparableString: string, MyCompareable{MyComparable implementation here}
interface MyComparable{operator overloading methods signature}
++++++++++++++++++++++++++++
From what I learned, operator overloading are static methods. COuld you pls advise what are the options to do it? Not a full code only the structure, methods signatures and access modifiers. I'd appreciate to know what are the considerations in chosing each way. I hope it is not too much too ask.
Many thanks for your help, hopefully my next questions will be much briefer.
Vered
|
|
|
|