|
Before all Thanks for your attention and Help !
I want to translate Exception to my Language (Persian,Farsi) then show the translate exception.(Note: I dont want to write down the error in catch like bellow:
try
{
}
catch
{
messagebox.show("Not like this");
}
OR
try
{
}
catch(Exception ex)
{
messagebox.show("Not like this");
}
OR
try
{
}
catch(FormatException ex)
{
messagebox.show("Not like this");
}
|
|
|
|
|
Isn't this exactly the same question that you posted three hours ago under the title ERROR?
It is generally considered bad form to post the same question multiple times.
|
|
|
|
|
You have been give the answer to this already; try reading the MSDN documentation on C# exceptions.
MVP 2010 - are they mad?
|
|
|
|
|
U can open a dialog by following way(Win7 OS):
Control Panel\All Control Panel Items--Network and Sharing Center
bellow View your active networks
CLICK Connections:local area connection ,you can see a window about local area connection status.
I want to get information on this window,such as
General-Connection-
IPV4 Connectivity : Internet
IPV6 Connectivity : No network access
Thanks very much!
-------------------------------------------------------------
i find that IPV4 Connectivity value is a best way to detect the availability of Internet.Using Ping Ip or get request from server is NOT a reliable way.
modified on Thursday, January 28, 2010 8:36 PM
|
|
|
|
|
|
I've used wmi ever ,but the API called Win32_NetworkConnection don't fit my requirement.
or
[DllImport("wininet.dll", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
private static extern bool InternetGetConnectedState(ref int lpSFlags, int dwReserved);
I only want to get the status the same as I mentioned from my question.
|
|
|
|
|
|
y u people r not answering my ques..or doubts..
i have added two buttons (ADD,UPDATE)
how to delete,update the selected records from grid view
|
|
|
|
|
|
i know thats basic ques..but i believe on the lessons taught by experienced guy ....so i m communicating like this....
jus now started my carrier as developer..
so dont mistake me
|
|
|
|
|
sorry,i didn't konw u r a beginner.
I suggest u'll find a tutorial book for beginner(publish by Apress).
I think u'd better buy that from a bookstore or Amazon.
Do more exercise and memorized the code from start.
Good luck!
|
|
|
|
|
But Jhon Simpson the Outlow programmer answeared your question.
Use
cmd.Parameters.AddWithValue("@name", name);
cmd.Parameters.Add("@name", name);
As a side note, in order to work your class should extend the abstract class
AbsDoDoubtlyNitro witch is exactly what's missing from the ISpanishInquistion contract specified by John
|
|
|
|
|
Mos Dan - Lucian wrote: Jhon Simpson the Outlow programmer
You should runaway and hide.
"No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
ya i 've fixed before i saw ur ans...
thanks a lot for responding me.....
|
|
|
|
|
Mos Dan - Lucian wrote:
But Jhon Simpson the Outlow programmer answeared your question.
Ummmm... you are risking death by spelling my name wrong.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Mos Dan - Lucian wrote:
But Jhon Simpson the Outlow programmer answeared your question
I quite like the word answear. It's an answer, but R rated.
|
|
|
|
|
In the designer click on gridview, edit columns, and then add commandfields
|
|
|
|
|
hi all,
im new to the c# world..
there is some error showing on my test program..
it shows "InvalidCastException was unhandled by user code"..
using VS2008 pro to code..
wat is tat suppose to mean??
anyone can help me??
any help are deeply appreciated..
thank u..
best regards,
A.Kogulakannan
|
|
|
|
|
Well you have a value/variable that is trying to be converted into another datatype which is not allowed such as;
DateTime testValue = Convert.ToDateTime(23);
This will also cause an "InvalidCastException" if it is not handled in a try/catch block.
|
|
|
|
|
Hi,
you tried to cast an object which wasn't able to cast (maybe it is null). If you post the code, it could be possible that we spot the line...
Regards
Sebastian
|
|
|
|
|
object ICOSDriver.Document
{
get
{
//return null;
throw new NotImplementedException();// ==>> shows error here while debug.
}
}
thank u..
|
|
|
|
|
I guess returning a null value will fail by the code consuming the ICOSDriver.Document property. Where do you use the property?
|
|
|
|
|
public void ReadCard()
{
string s = string.Empty;
i_targetCOSDriver.CreateDocument();
targetSmartDoc = (ISmartCardDoc)i_targetCOSDriver.Document; //==>>here
if (targetSmartDoc == null)
return;
// Separate reading because the data fall in different Data Record Set
ReadMPPNo();
ReadICNo();
ReadPhoto();
ReadThumbData((int)PassportDataRecord.THUMB_1, (int)PassportDataRecord.THUMB_2); //Thumb1
cs_targetCOSDriver.Terminate();
}
|
|
|
|
|
So,
when you return null and try to cast the value explicit, the instruction
targetSmartDoc = (ISmartCardDoc)i_targetCOSDriver.Document;
will fail. I suggest that you should use the "as" instruction, which will work with null and cast failures without raising an exception.
targetSmartDoc = i_targetCOSDriver.Document as ISmartCardDoc;
That should work...
Regards
Sebastian
|
|
|
|
|
guess wat.. it works!! thanks a lot sebastian..
|
|
|
|