|
It depends on the client application (ASP.NET, Console, or WinForm).
In all cases, I would build a string that explains the exception, including any property particular to the SqlException class.
When the string is ready, there are many ways to display it to the user:
ASP.NET: You may use a label.
WinForm: MessageBox
Console: Console.Error.WriteLine
Some piece of advice:
- When displaying error information, give the user the tools to fix the problem, by telling as much as possible to the user. In the case of the SqlException class, there are the Procedure, LineNumber, Number, etc. properties. There is nothing more frustrating than the "An error occured" message.
- In the Console version, notice the use of the Error StreamWriter property of the class. I do this, because the Console.WriteLine call outputs to the regular output stream.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hello!
Remember, in setup of account record Outlook there is an opportunity to open postbox of other user.
How to retrieve contacts list other Outlook user postbox?
I shall be grateful for any information on the given question.
Thanks,
Alexander
|
|
|
|
|
How can i draw a line or rectange in a ASP.net Web form by getting the points from the user or by using mouse down event.
Rohit
|
|
|
|
|
The mouse events are obviously client side, so you would do it using Javascript or something. As it is client side, there is nothing specific .NET related to this. And no, I can't point you to any information about how it is done - I have seen someone doing similar things, but I avoid Javascript whenever posibile so I have no intention finding out how it is done.
Alternatively embed a WinForm control on the page. This is probably easier to program but it will only work if the client has the .NET Framework installed.
|
|
|
|
|
thanks a lot for ur reply. Can u just tell me any of the sites where i can get a smple javascript code for that
Rohit
|
|
|
|
|
As I said, I do not touch Javascript so I have no idea where to find samples. Life is too short for weakly types scripting languages.
|
|
|
|
|
|
rTB2.Clear();
int i = 0;
string s = rTB1.Text;
string substr = "";
switch(rTB1.Text)
{
case '"':
{
while (i < s.Length && s[i]!='"' && s[i]!='\n')
{
substr += s[i];
i++;
}
rTB2.Text += "String - " + substr + "\n";
substr = "";
}break;
}
|
|
|
|
|
This is my code. If you see s = rTB1.Text. So you simply rewrite my code. If you can, please help
|
|
|
|
|
a very simple method is to get the first index of " (opening quotes)
and then get the next index of the " (closing quotes)
and the get the substring within those indices
Regards,
Pramod
|
|
|
|
|
I guess You are right, but I mess up something so i could not use that way of solving the problem. If you could give me an example, will be appreciated.
Regards,
Mitko
-- modified at 5:29 Tuesday 7th March, 2006
|
|
|
|
|
try this one
if(richTextBox1.Text != "")
{
string str1 = richTextBox1.Text;
int i= str1.IndexOf('\"');
int j = str1.IndexOf('\"',i+1);
string str2 = str1.Substring(i+1,j-i-1);
richTextBox2.Text = str2;
}
Regards,
Pramod
|
|
|
|
|
You could use a regular expression to parse the string.
Using a pattern like "([A-Za-z]+|\"[A-Za-z ]+?\")" would capture all "identificators" and quoted phrases in the string.
---
b { font-weight: normal; }
|
|
|
|
|
Can any one guide me about exporting entire database (and not a single table) in SQL server in to Micrisoft Excel 97-2000 and vise versa ? Similar to DTS Import/Export Wizard in SQL Server Enterprise Manager.
Well, I want to do this in C#
warn regards
Sachin
-- modified at 4:16 Tuesday 7th March, 2006
|
|
|
|
|
|
Hi all,
Is there a 2D array list? Basically I need a 2D dynamic array. Thanks in Advance. Cheers.
|
|
|
|
|
ya u can surely create a 2D arraylist
e.g.
Arraylist arrlst = new ArrayList[count];
for(..)
{
arrlst[i] = new Arraylist();
arrlst[i].Add();
}
Regards,
Pramod
|
|
|
|
|
public struct Int32 : IComparable, IFormattable, IConvertible, IComparable<int>, IEquatable<int>
how do you make a structure like Int32 , for exemple
NewInt i = 15;
|
|
|
|
|
|
Hi all,
i have 3 projects in my solution suppose Project1, Project2...
and in the startup project i.e. in Project1 i have an XML file which
i want to access in another project i.e. Project3.
i can access it using the physical path for now, but
i want to use the virtual path for accessing that because on
the clients end the file may be stored on any partition of the System which is unknown.
can anyone tell me what should i use to access the file?
Thanks,
Pramod
|
|
|
|
|
you can search on Server.MapPath()
might be help you
Amit Grover
CDAC R&D
|
|
|
|
|
i want to do that in Windows application in C#
Thanks,
Pramod
|
|
|
|
|
Go thru System.IO.Directory or File class
May be help u
Amit Grover
CDAC R&D
|
|
|
|
|
I know this might be a stretch but I'm trying to insert an image into a RichTextBox and make it a link.
I currently insert an image using the methods presented by, Khendys Gordon: www.codeproject.com/cs/miscctrl/csexrichtextbox.asp
and am successful in doing so. But when I actually go to set the inserted image string as a link, the image isn't displayed.
So I'm begining to think it isn't possible but thought I would ask others.
Thanks,
Eric
|
|
|
|
|
if u can write event handlers for that image it would be easy
u can write the Mouse Hover event and change the cursor to Hand in this event
and in the click event of the image u can redirect to the link that u want
Regards,
Pramod
|
|
|
|