ADO.NET output type question
Q. You are a Web developer for CareerRide. The data is stored in a Microsoft SQL Server 2005 database on a server named CareerPC and the Database name is TestDB. There is one GridView control on the page that you want to fill with table name Employee. Suppose that SqlConnection object is conObj and SqlCommand Object object is cmdObj. Which important properties of command object you will initialize to achieve this task?- Published on 28 Jul 15a. cmdObj.CommandType = Text;
cmdObj.Connection = conObj;
cmdObj.CommandText = "select * from Employee";
b. cmdObj.CommandConnection = conObj;
cmdObj.CommandText = "select * from Employee";
c. cmdObj.CommandType = CommandType.Text;
cmdObj.Connection = conObj;
cmdObj.CommandText = "select * from Employee";
d. None of the above.
ANSWER: cmdObj.CommandType = CommandType.Text;
cmdObj.Connection = conObj;
cmdObj.CommandText = "select * from Employee";