When executing scripts in SQL Server Management Studio, messages are often generated that display in the message window. For example when running a backup of a database:
10 percent processed.
20 percent processed.
Etc...
Processed 1722608 pages for database 'Sample', file 'Sampe' on file 1.
100 percent processed.
Processed 1 pages for database 'Sample', file 'Sample_Log' on file 1.
BACKUP DATABASE successfully processed 1722609 pages in 202.985 seconds (66.299 MB/sec).
I would like to be able to display these message in a C# application that is running SQL scripts against a database. However, I cannot figure out how to get a handle on the message output from SQL as it is generated. Does anybody know how to do this? It doesn't matter to me which connection framework I have to use. I'm relatively comfortable with LINQ, NHibernate, Entity Framework, ADO.Net, Enterprise Library, and am happy to learn new ones.
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
Full form of C is “COMPILE”. One thing which was missing in C language was further added to C++ that is 'the concept of CLASSES'. So ++ being the increment operator, C has an incremented version called as “C++”.
It is fast The programs that you write in C compile and execute much faster than those written in other languages. This is because it does not have garbage collection and other such additional processing overheads. Hence, the language is faster as compared to most other programming languages.
C has the features of both assembly level languages i.e low-level languages and higher level languages. So that's why C is generally called as a middle-level Language. The user uses C language for writing an operating system and generates menu driven customer billing system.
The SqlConnection.InfoMessage event occurs when SQL Servers returns a warning or informational message. This website shows a possible implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With