what are the two key events for the sql connection class?
explain the differnce between the two.

Answers were Sorted based on User's Feedback



what are the two key events for the sql connection class? explain the differnce between the two...

Answer / srikanth r

The two key events are InfoMessage and StateChange events.

InfoMessage event occurs when informational message is
returned from data source that do not results in throwing
an exception.
StateChange event occurs when there is a change in
Connection to the data source.

Is This Answer Correct ?    23 Yes 1 No

what are the two key events for the sql connection class? explain the differnce between the two...

Answer / annie

The two key event of sqlConnection class are:
StateChange event:Occurs only when the state of the connection with the database changes. The evnthandler receives an argument of type StateChangeEventArgs. This argument contains data related to that perticular event.
The properties of this event are: CurrentState and OriginalState.
InfoMessage event: Occurs only when an informational message returned from the database having connection with. The event handler receives an argument of type SqlInfoMessageEventArgs. This argument contains the data related to that particular event.
The properties of this event are: Error,Message and Source.

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More ADO.NET Interview Questions

Which type of database is used while processing dynamic database?

1 Answers   Microsoft,


what is the syntax code to oledb to connect oracle

6 Answers   IBM,


Explain what are acid properties?

0 Answers  


If we are not returning any records from the database, which method is to be used?

0 Answers  


What are the rules to implement connection pooling?

0 Answers  






Explain how to pass multiple tables in datasets simultaneously?

0 Answers  


What is the difference between the clone() and copy() methods of the dataset class?

0 Answers  


Difference between function and trigger?

1 Answers   HCL,


Difference between DataReader and DataAdapter / DataSet and DataAdapter?

3 Answers   TCS,


How To Update A Column In A DataGrid Using C#.NET? I am getting InvalidCastException as (Specified cast is not valid) while updating 2nd column in a datagrid? Id,firstname,lastname are the three columns of my datagrid respectively. I wanted to edit the second column(lastname) and update it. I did the following code in DataGrid's updatecommand(),but failed to update ! Int varid=(int)DataGrid1.DataKeys[e.Item.ItemIndex]; TextBox lnm=(TextBox)e.Item.Cells[2].Controls[0]; string str=lnm.Text ; SqlCommand cmd=new SqlCommand("update customer set lastname='" + str + "' where id=" + varid + "",con); cmd.ExecuteNonQuery(); DataGrid1.EditItemIndex=- 1; DataGrid1.DataBind();

2 Answers   Mind Tree, TCS,


What are the different methods by which we can populate a dataset?

0 Answers  


Can we do database operations without using any of the ado.net objects?

0 Answers  


Categories