Which of the following is the correct syntax for using Dictionary object in your code:
using System.Collections.Generic; Dictionary < string , StringBuilder >() dctobj = new Dictionary < string , StringBuilder >;
using System.Collections.Generic; Dictionary < string , StringBuilder > dctobj = new Dictionary < string , StringBuilder >();
using System.Collections.Generic; Dictionary < string , StringBuilder > dctobj = new Dictionary < string , StringBuilder >;
using System.Text; Dictionary < string , StringBuilder > dctobj = new Dictionary < string , StringBuilder >();
Which of the following is not true about Microsoft Silverlight:
Both cross browser and cross platform compatible
XAML can be used for programming user interface
Can be considered as replacement for Windows Presentation Foundation
All of the above
You have following two code segments to read records from flat-file/excel: Code segment 1: OleDbConnection con; con = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + System.IO.Path.GetDirectoryName(filename) + "; Extended Properties = \"Text;HDR=YES;FMT=Delimited\""); Code segment 2: OleDbConnection con; con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";Extended Properties=Excel 8.0;"); Which one of following is true:
both can create connection to excel and flat files
only second can create connection to excel
first one can create connection to both excel and flat files, whereas second one can craete connection only to Excel
None of the above
Suppose you are implementing paging to your datagrid named grdtest using following code: protected void grdtest_PageChanger(object Source, DataGridPageChangedEventArgs E) { DataTable dttable = new DataTable(); //populate dttable with appropriate data from database grdtest.DataSource = dttable; grdtest.DataBind(); } what is the main thing missing in above code:
grdtest.AllowCustomPaging = true;
grdtest.AllowPaging = true;
grdtest.CurrentPageIndex = E.NewPageIndex;
Both i and ii
Which of the following is false for Managed Code performance improvement:
Late binding defers type identification process until run time, so prefer Late Binding whenever possible
Always enable Option Explicit and Option Strict options(while using Visual Basic.NET)
If Com objects is referred in code, destroy COM objects always after use
While implementing threading, do not use Thread.Abort to terminate other threads
Which is false about reading/writing XML data using System.Xml:
XPathDocument class is very fast, but it is read-only
The XmlDocument class provides editable representation of XML document, but is comparatively slower.
XPathNavigator object can be created using both XPathDocument and XmlDocument classes, which can be used to to select and navigate XML data.
Consider the table and query below: Table Name: products category type price indoor kitchen 1.50 outdoor garden 6.00 indoor Bathroom 4.75 outdoor garden 20.20 indoor bathroom 4.25 Office desktop 9.80 SELECT category, COUNT(DISTINCT type) FROM products GROUP BY category How many rows are returned by the SQL statement listed above?
One row
Two rows
Three rows
Four rows
While creating a view from two tables, you need to ensure that view cannot be affected by modifications to underlying table schema. What should you do to accomplish this goal with least possible amount of overhead?
Create CHECK constraints on the tables
Create a DDL trigger to rollback any changes to the tables if then changes affect the columns in the view.
Create the view, specifying the WITH SCHEMABINDING option.
Create the view, specifying the WITH CHECK option.
Which of the following is true about xp command shell in SQL Server 2005:
xp command shell can be enabled by sysadmin by executing following: EXEC sp_configure 'xp_cmdshell', 0;
xp command shell is enabled by default;
xp command shell can be used to run bcp utility
None of above
You have created a cursor named test_cursor inside your stored procedure. Following is the cursor code: --------------------------------------------------------------------- DECLARE @Name AS VARCHAR(100) DECLARE test_cursor CURSOR FOR SELECT empname FROM Employee Order BY empid OPEN test_cursor FETCH NEXT FROM test_cursor INTO @Name WHILE @@FETCH_STATUS <> 0 BEGIN -- Do your internal procesing here FETCH NEXT FROM test_cursor INTO @Name END CLOSE test_cursor DEALLOCATE test_cursor --------------------------------------------------------------------- What correction is required in the code above?
First Deallocate and then close
Use @@FETCH_STATUS = 0 instead of @@FETCH_STATUS <> 0
No need to use "FETCH NEXT FROM test_cursor INTO @Name" again before END statement