|
What exceptions cannot be caught by try-catch block?
StackOverflowException for one. (Just try write a simple infinite recursive function and invoke from a simple WIN32 console main)
What else?
dev
|
|
|
|
|
There aren't that many that can't be caught. Off the top of my head, the only other one I can think of is an OutOfMemoryException.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: the only other one I can think of is an OutOfMemoryException.
I'm sure I've got code that catches those?
It definitely isn't definatley
|
|
|
|
|
well here's one mysterious
<br />
try {<br />
IPerson oPerson = ISession.Get(....);<br />
...<br />
oSomeProperty = LoadProperty(...);
<br />
oPersom.SomeProperty = null;
oPerson.SomeProperty = new PersonProperty(...);
oPerson.SomeProperty = oSomeProperty; oPerson NOT NULL!!<br />
<br />
<br />
} catch(Exception ex)<br />
{<br />
Console.WriteLine("Tell me everything..."); Exception? try-catch never caught it?!<br />
}<br />
<br />
class Person<br />
{<br />
protected PersonProperty _SomeProperty = null;<br />
...<br />
public PersonProperty SomeProperty<br />
{ <br />
get { return _SomeProperty; }<br />
set {<br />
_SomeProperty = value; << Actually it crashed right here.<br />
}<br />
}<br />
...<br />
}<br />
no clue - even if it was a stackOverflowException Visual Studio will tell me. But this one, I step as close to problem as I could by tracking it down to SomeProperty setter in Person class. I can't go lower - I don't have .NET source code!
dev
modified on Wednesday, April 1, 2009 5:25 AM
|
|
|
|
|
There was an article[^] posted in the lounge the other week converning problems with the Large Object Heap (LOH).
There is some sample code in there that catches out of memory exceptions and forces a GC.Collect(). I suspect that this might only work because the the LOH is unable to allocate more memory but there is still available memory in the small object heaps (SOH). I'd imagine that if you were to use all memory on the SOH's that you wouldn't be able to catch the exception, but there are definitely circumstances where the exception can be caught and handled appropriately.
It definitely isn't definatley
|
|
|
|
|
hey appreciate it, let me take a look at this NOW! i've been tormented... this "SomeProperty" is actually a complex object graph but at the time when this failed (which happens every single time so it's not like it's sporadic or indeterministic) the graph is quite shallow/simple... alright let me clear my head and start reading!
dev
|
|
|
|
|
oh... it's not LOH because at the time when it breaks the object graph still small - i.e. far less than 85,000 bytes (My guess is that it should be about 5000 bytes only, there's no easy way to determine size of complex graph of reference type... so...)
dev
|
|
|
|
|
I've found it
some framework code called Person.ToString after setter set, which resulted in infinite recursion (parent->child->parent sort).
Thanks!
dev
|
|
|
|
|
Off the top of my head, the LoaderLock exception seem to slip through the net. But anything that's invoked by Environment.FailFast seems to do the trick
|
|
|
|
|
class Node
{
int[] State = new int[2];
Node *[] Ptr;
}
how can i have a class like this please help me to use unsafe keyword for using this array of pointer and how can I declare my Ptr array cells?
|
|
|
|
|
unsafe class Node<br />
{<br />
fixed (int* ptr = &array[10])<br />
}
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Hi friend
How to create windows xp user using c# code
plz help me
Thanks and regards
Azad yadav
|
|
|
|
|
Check the DirectoryEntry class and the objects Invoke method...
Have a Happy Coding.....
|
|
|
|
|
|
Hello.
Problem: Need import from CSV file information in the GridView.
File Format:
"MachineName", "Hostname", "IP Address" (to a new line)
"Machine", "MachineHost", "127.0.0.1" (to a new line)
"Machine2", "MachineHost2", "127.0.0.1"
And respectively insert into GridView, with fields : MachineName, Hostname, IP Address.
Thanks.
|
|
|
|
|
read the file line by line...
split each line...
enter each value into a gridview column...
end
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
can you explain a way that I can use a pointer member in my class in c#?
sample:
class test
{
int Number;
test *[] Ptr;
}
|
|
|
|
|
I think you just need to use the 'ref' (reference) keyword...
class test
{
int Number;
test ref Ptr;
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
C# does not support pointer arithmetic. use unsafe keyword.
unsafe class test
{
int Number;
test *[] Ptr;
}
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Ok, My appologies if this is in the wrong section. I couldnt tell if it was a problem with sql server, or my code.
Im building a small app that grabs some data out of my sql server express 2005 database, and tosses it into a dropdown list. Simple enough.
I decided to go with a WPF gui, so I could drop it onto my web server and view it via IE.
My app works great on every box I try it on, on the local network (after getting all the certificate validation done). However, when I try to access it from a computer from outside the network, it runs into a bunch of sql server exceptions. My web server and sql server are running on the same machine.
I dont know if its the connection string failing from an outside network, or maybe I just dont understand how its trying to access the sql server. Here is the connection string I use to establish the connection.
SqlConnection con = new SqlConnection(string.Format(@"Data Source=MyComputerName\SQLEXPRESS;Initial Catalog=MYDB;User Id=me;Password=mypw;"));
When I connect to my .xbap file on the webserver from outside the network, I get 'An error occurred in the application you were using' and the following error in the 'More Information'
--The Error is quite verbose, so i tried to only include a portion of it--
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
If more information would be useful, let me know.
|
|
|
|
|
josephchild wrote: and that SQL Server is configured to allow remote connections.
By default, SQL Express will refuse any connections that are made to the database that originate from outside of that computer. That setting can be changed, off course. Read about it here[^].
I are troll
|
|
|
|
|
the article you mention says:
Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
** In the sql server 2005 Surface area configuration: I have my settings set to 'Local and remote connections' with 'Using both TCP/IP and named pipes'
Turn on the SQL Server Browser service.
** In the sql server 2005 Surface area configuration: I have the SQL Browser service running, and startup type set to Automatic
Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.
** I have no firewall enabled. I even made sure port 1433 is being forwarded to my server. I also tried setting the computer up as the DMZ.
Do you have any more suggestions? I really appreciate your help in this.
I am able to connect and run my app from other computers on my network. I just am unable to connect and run the app from outside the network.
|
|
|
|
|
Sounds like your settings are correct and that there's something on your network that's preventing the connection. Have you tried from a different network? At that point I usually try to find a good network-admin to help me
I are troll
|
|
|
|
|
unforturnately I dont think I'll be able to try from another network. I cant think of anything preventing the connection. My web server Im using is Apache/2.0.55 win32 .. I cant think of any reason it would be apache keeping this from working. From what I understand, it seems that the app is having a problem hitting the sql server, and that I might have some setting wrong. If you or anyone else has any ideas, I would be happy to hear them.
|
|
|
|
|
I want multiple equation in any Textbox like plus ,minus , multiply, Subdivision
Example: 4+9-5*12/3=32, How it possible ?
|
|
|
|