|
Problem solved!!!
Turns out that im right about the Time Offset, i just needed to shift the boolean array acording to my time zone....
|
|
|
|
|
Hi friends,
I want to search a word/phrase of words(Like search inGoogle) in XLs/PDf or Doc file.The files are Stored under a folder in local machine.The application as a ASP.Net Application using C#.
But i am finding no way out there to do so.i need ur help.
Please help me in this regard.
|
|
|
|
|
|
Hi guys
im sitting with a little delema. i need to determine which kind
of SqlException was thrown by sql. i tried using SqlException.ErrorCode like so
<code lang="cs">
try
{
}
catch(SqlException sqlEx)
{
if(sqlEx.ErrorCode == -2146232060)
{
}
else
{
means of a messageBox that displays the
errorCode and errorMessage
}
}
</code>
now i initially thaught that -2146232060 is the error code for violating a unique constraint, but i later noticed that the exact same code is used when there is no longer access to the db
i need to be able to handle these exceptions in different ways
how exactly can i determine what actualy went wrnog on the sql end so that i can prompt the user accordingly EG. "user alredy exists" or "database no longer avalible"
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
|
|
|
|
|
Hello,
As the SqlException can return more than one, you would have to iterate over the Errors (SqlError[]) and check the "Number" Property there.
MSDN Example:
catch(SqlException exception)
{
for (int i = 0; i < exception.Errors.Count; i++)
{
Console.WriteLine("Index #" + i + "\n" +
"Source: " + exception.Errors[i].Source + "\n" +
"Number: " + exception.Errors[i].Number.ToString() + "\n" +
"State: " + exception.Errors[i].State.ToString() + "\n" +
"Class: " + exception.Errors[i].Class.ToString() + "\n" +
"Server: " + exception.Errors[i].Server + "\n" +
"Message: " + exception.Errors[i].Message + "\n" +
"Procedure: " + exception.Errors[i].Procedure + "\n" +
"LineNumber: " + exception.Errors[i].LineNumber.ToString());
}
Console.ReadLine();
}
All the best,
Martin
|
|
|
|
|
Thanx! it worx perfect
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
|
|
|
|
|
Glad I could help!
You are wellcome!
All the best,
Martin
|
|
|
|
|
Wouldn't this befit SQL/aDO.NET forums rather?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
People get confused as to where to post questions all the time. I can see where the confusion would come from if you are coding in C# and having SQL issues. There are two forums to post the question. Usually they just post the question in both spots, and about just as often, they post on completely wrong forums.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi everybody!
I want to develop a dll using C# which can capture client screen. After build dll I will use into my asp page as following example :
<%
set ob = Server.CreateObject("namespace.PublicClass")
.....
ob.CaptureScren()
.....
%>
Can anybody help me?
Thanks to all..
monsur hoq
|
|
|
|
|
making a screeshot of the client machine from within an asp page?
i don´t think that this is possible at all...
|
|
|
|
|
|
well , i don't think there is a way of making client-side screenshots from within an asp page (as long as you stay with asp and don't talk about activex controls and such stuff).
actually it's a good thing that an asp page just cannot make client-side screenshots.
otherwise you would run into some serious security problems.
the only thing you could probably make is a rendered image of your website, but that would just contain the website and nothing else.
why do you want to make screenshots from within asp?
joachim
|
|
|
|
|
I want to make such a web application for creating presentation as user demand. Pls help me.
|
|
|
|
|
i just cannot see what presentations and screen shots have in common...
|
|
|
|
|
That code would run on the server, not on the client. It would capture the server screen instead of the client screen, but as the web server process doesn't have a user interface, it will not be able to capture anything at all.
To be able to capture the client screen, you would have to build an ActiveX component that you could run in the browser.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Dear Guffa,
Thanks for your suggestion.
Can you help me how to develop an ActiveX component using C#?
Have you any help according your suggestion?
monsur hoq
|
|
|
|
|
I haven't done it myself, so I don't really have any input on it.
search for "c# activex"[^]
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hello friends,
I am developing an windows application and making connection string in APP.config file like this:
<configuration>
<appsettings>
<add key="ChatConnectionString">
value="Data Source=sql.xyz.com; Initial Catalog =mydatabase; uid=xyz; pwd=xyz;"/>
now i am using this connction string in my application like this:
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationSettings.AppSettings["ChatConnectionString"];
but ist showing an error that "THE ConnectionString property has not been initialized"
Please giv me any appropriate solution
|
|
|
|
|
is the "key"-attribute in your config file "ChatConnectionString" ?
|
|
|
|
|
Hi Guy
In your above code have two possiblity for that error will come
1.Your connection string not in AppSettings Tag in App.Config
2.if Connectionstring with in the AppSettings, key name will be wrong.
So Check those two and call correct way.
if you connectingstring in ConnectionString Tag in AppConfig.config file, u must call like this.
ConfigurationManager.ConnectionString["KeyName"];
or ur way is right.
check those two possiblity and change your code and run.
Thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
I'm using VS2005. This happens only sometimes.
If I block a code using mouse, then press Ctrl-X to cut it,
it crash my VS2005. I must restart it. After restarting it,
my VS2005 going normal again.
Anybody have the same problem ?
|
|
|
|
|
Nope, and I've used it every day for 3 years now.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
possibly a source control issue?
|
|
|
|
|
Hi
I have 2 algorithms that I want to compare (in terms of raw execution speed). Although I have already checked the theoretical difference (O-notation) I would also like practical results since each statement may influence the run-time in a way that theoretical techniques can not identify as easily.
So my question is: How can I most accurately benchmark the run-time of a code snippet? I did this in C++ once with a library called miracle and there it was just a matter of storing the time before execution and after execution and then subtract, however I do not know C#'s capabilities for reliable and accurate results.
Any thoughts would be appreciated.
|
|
|
|