|
Hi , have a good day ...
I don't know if this is the right place for my Question ...
so please excuse me if I am worng ....
My Question is :
if I excute On SQL Query Analyzer this Syntax (
dbcc checkdb ('master') )
then the SQL Query Analyzer will print a message like this :
DBCC results for 'master'.<br />
DBCC results for 'sysobjects'.<br />
There are 1221 rows in 23 pages for object 'sysobjects'.<br />
.<br />
.<br />
How I can read Such a thing with C# Windows Application ...
I need a hint , don't bother your self for writting a code ,
But I will be happy if you did ...
Kimd regards
Thank in Advance
I know nothing , I know nothing ...
|
|
|
|
|
Hi,
if you launch the analyzer from within a .NET app (using Process.Start), you can catch the output and error streams, and deal with their content any way you see fit.
In general the correct way is by using three threads: one reading the output stream, one reading the error stream, and one orchestrating the launch and the termination; something the MS examples fail to illustrate.
For fast jobs without much output, you can do without it all, just ReadToEnd on both streams (which means you will get output only when all is done).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: if you launch the analyzer from within a .NET app (using Process.Start), you can catch the output and error streams, and deal with their content any way you see fit.
Correct me if I am wrong - Analyzer is not a console application. So how can you predict where this output message is coming and read only that portion from your application? I don't think it is possible.
Any thoughts?
|
|
|
|
|
Oh.
If it is a WinForm app, one can always try and get the text from the Control that holds whatever is relevant... (using some P/Invoke that is).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Have you tried executing that command using command.ExecuteReader() and look in the reader?
|
|
|
|
|
Hi, I know it was a long time , But i didn't forget to thank you , for your help ....
-----
I found the solution for my question , and I will posted it here ...
may be this piece of code will help other people ...
<br />
public void ApplySqlInfo()<br />
{<br />
SqlCon.InfoMessage += new SqlInfoMessageEventHandler(SqlCon_InfoMessage);<br />
SqlCon.FireInfoMessageEventOnUserErrors = true;<br />
}<br />
<br />
public void SqlCon_InfoMessage(object sender, SqlInfoMessageEventArgs e)<br />
{<br />
Console.Writeline(e.Message);<br />
}
thank you ...
I know nothing , I know nothing ...
|
|
|
|
|
Using Vista Home Premium - everything up to date.
I'm the Admin and sole user of this machine.
Downloaded C# Express.
Tried to create new project and got this error msg: "Required registry access is not allowed"
Could not create the project.
Reinstalled C# and tried again. Same result.
Been using VB.net Express since '05 and never saw this error before.
Any ideas?
|
|
|
|
|
Hi,
Visual Studio Express edition works fine for me under Vista Home Premium (C#, VB.NET, C++/CLI).
I googled Visual "Required registry access is not allowed" and found some 12 hits indicating you are not alone, unfortunately the promising Microsoft links all were broken...
There was one hint: disabling UAC, then re-enabling UAC (may take two reboots); everything else was changing lots of things in the registry...
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Tried playing with the UAC but the problem persists. I also found a lot of broken links in the Questions section of the C# documentation.
From what I've seen, MS is as clueless about it as I am. Not good.
|
|
|
|
|
Run Visual Studio As Administrator.
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: Run Visual Studio As Administrator.
According to the title bar of C#, that's what I'm doing - it says "(Administrator)".
|
|
|
|
|
I have some place in my code that i update my database(using Access db).
After i did this update - i try to get from some other place in my code the fresh data from this database.
For some reason i see that i get the old database data (i get the data before i update this database). But when i add some sleeping time (Thread.Sleep(5000)) before getting the fresh data i see that the data was update correctly.
How can i fix this problem ?
How can i know if the update of the database table was done ?
|
|
|
|
|
Are you using a separate thread to update the database.
If so, Use ManualResetEvent object to Set when update is successfully done.
And in the main thread use WaitOne function to wait until the child thread finishes its job.
You can also use Thread.Join to do this as well.
|
|
|
|
|
No,
In my application i have only one thread, so its does not look like thread synchronize problem.
|
|
|
|
|
|
No - as the program will be in use!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
As Dave said - no, but why on earth would you want to do this? The only reason I can see for this would be to try to put something malicious on a machine which removes itself when it's completed it's nefarious purpose. As you earlier posted about wanting to write a key logger, I'm highly suspicious of what you are hoping to accomplish.
"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
|
|
|
|
|
Please stop deleting your messages, just because you don't like the answers you're getting.
"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
|
|
|
|
|
|
nike_arh wrote: Hi! I recently started working on internet applications. I wondered what is the principle behind programs like TeamViewer. How do they work, because I'm interested in making my own similar program.
Errrm. You did see the honking great bit of text at the top that said this was the C# forum didn't you? I mean - I can see that it would be easy to miss, what with it being twice as big as the rest of the text and green. I mean, c'mon; couldn't they have made it any more apparent that this section was about C# code and nothing whatsoever to do with asking questions about commercial applications?
Would you like to go away now, or shall I mock you some more?
"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: Would you like to go away now, or shall I mock you some more?
You sons of a silly person!
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
More! More!
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Jörgen Sigvardsson wrote: What's your beef with this guy? He wasn't rude, he didn't ask you to do his homework, and he didn't offend anyone.
|
|
|
|
|
Hello,
I have 3 types of resources embeded in my executable :
html, jpg and pdf. I also have a listbox, and I want whenever a user sleects a different item, to display it in a web browser.
I have no problems doing that to HTML files, but with the other one, it's a different thing and I hope someone can help me do this.
First, I want to say that I don't want to save the resources locally and after that load them in the browser, because I don't want users to see them.
I am using this to view the html :
<br />
Assembly assembly = Assembly.GetExecutingAssembly();<br />
webBrowser1.DocumentStream = assembly.GetManifestResourceStream("ebook.index.html");
If I try to do the same thing to the pdf or jpg, it simply shows me the binary data of the files, it does not display them in the browser.
Is it possible to make the visible in the browser, directly from the assembly ? What are my options ?
Thank you
|
|
|
|
|
Hi,
I haven't done this myself, but the way I understand it you must also set the WebBrowser.DocumentType (try "application/pdf"); that should allow you to view a PDF document (or any image) as a web page.
You probably also want images inside web pages, so have a look at embedded images[^].
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|