Download
100% FREE
Office Document APIs for .NET
Online: 3054
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Exclusive Interviews
> C#
C# Exclusive Interview Questions and Answers (453) - Page 6
A joint initiative from DotNetFunda.Com and Questpond.
A one stop place on the internet to get trusted and proven Interview Questions (based on more than a decade of experience in this field) to ensure the success of the candidates.
You will find almost all Interview questions from Questpond here and this list is growing day by day with all latest and updated interview questions.
453 records found.
Post Interview
|
Interview Experiences
|
Interview FAQs
|
Online Interviews
|
Interviews Home
Get 650+ Questpond's Interview videos on discount
Loading ...
What is the core ADO.Net assembly?
System.Data.dll
What is the namespace for MS SQLServer Mobile?
system.Data.SqlServerCe
When should we use Oledb provider to SqlClient ?
If we need to communicate with MS sql server version 6.5 or earlier
" target="_blank">
Is the following Connection string correct?
NOTE: This is objective type question, Please click question title for correct answer.
private void Form1_Load(object Sender,EventArgs e) { SqlConnection con = new SqlConnection(); try { con.ConnectionString = @"Data Source = server;Initial Catalog = pubs;User Id= sa;pwd = Password"; con.Open() } } What is the output?
Compile time error. Expected catch or finally.
private void Form1_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(); try { con.ConnectionString = @"Data Source =server;Initial Catalog = pubs;userid=sa;password=password"; con.Open(); } finally { if (con.State = ConnectionState.Open) MessageBox.Show("Connection Successful"); else MessageBox.Show("Unsuccessful"); } } What is the output?
MessageBox------------->Unsuccessful. We will get run time error because User Id is the keyword.
private void Form1_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(); using (con) { con.ConnectionString = @"Data Source =server;Initial Catalog = pubs;userid=sa;password=password"; con.Open(); MessageBox.Show(con.State.ToString()); } MessageBox.Show(con.State.ToString()); } What is the output?
Closed. Open Closed.
What is the using statement?
The objects lifetime is controlled and that resources are cleaned up deterministically. The class which implements IDisposable should be used in the using statement.
what are the different constructors of command object?
SqlCommand(). SqlCommand(string cmdText) SqlCommand(string cmdText,SqlConnection constr) SqlCommand(string cmdText,SqlConnection con,SqlTransaction trans)
Which one of the following is preferred in fetching data from sqldatareader. dr[i] or dr.GetX(i) ?
GetX(i) is preferred because , we don't have to cast unlike dr[i] which returns an object and have to be casted.
Which method of command object is used to prepare the execution of parameterized sql statement?
What are the important methods of an SqlDataReader object?
Why is DataSet slower than DataReader?
As Dataset carry considerable overhead because of relations,multiple tables etc. speed is slower than "DataReader".Always try to use "DataReader" wherever possible, as it is meant especially for speed performance.
How can we specify port number in Connection String in App.Config file?
Connection String ="Server=.\sqlexpress,portnumber;Database=dbname;Uid=dbuser; Pwd=dbpassword" Here we can specify the port number which we want to use
@@Identity contains last identity value over given connection. Yes/No
Yes.Select@@Identity contains last identity value over given connectionand is different for every SqlConnection.
Can we have multiple .config files along with App.Config file???
We can have multiple .config files along with App.config file but we use only App.Config File.
The return type for ExecuteNonQuery() is ______________
NOTE: This is objective type question, Please click question title for correct answer.
The return type of ExecuteScalar() Method is _____________
The return type of Executescalar method is Object.
The Return Type of ExecuteReader() is ______________
The return type of ExecuteReader() is SqlDataReader.It is used for the execution of statements which return multiple rows and columns i.e., a set of records.
All Oledb Providers are __________ Components.
All Oledb Providers are COM components.
1
2
3
4
5
6
7
8
9
10
11
12
13
...
23
More C# Interview Questions & Answers here
Found this useful, bookmark this page to the blog or social networking websites.
Bookmark It
Exclusive Interview Questions and Answers Categories
.NET Certifications
.NET Core
.NET Framework
ADO.NET
Android
Angular
AngularJS 1x
Aptitute Test
ASP.NET
ASP.NET AJAX
ASP.NET Core
ASP.NET MVC
ASP.NET Web API
Aurelia
Azure
Best Practices
BizTalk Server
Bootstrap
C#
Cloud
CMS
CSS 3
Data Structures & Algorithms
Design Pattern & Practices
DotNetFunda.Com
Entity Framework
Error and Solution
F#
Function Points (FPA)
HR
HTML 5
IIS
Interview Questions
JavaScript
jQuery
Kinect
LightSwitch
LINQ
Management
Mobile Development
MSBI (SSIS, SSRS, SSAS)
Mule
Networking
News and Community
Node.js
NoSql
OOPS
Oracle
Others
PostgreSQL
PowerShell
Product Reviews
Project Management
Python
QA (Testing)
R Language
Regular Expressions
SEO
SharePoint
SignalR
Silverlight
Sql Server
TypeScript
UML
VB.NET
Visual Studio
WCF
Web Analytics
Web Services, Remoting
Windows 8
Windows Forms
Windows Metro
Windows Phone
WPF
WWF
XML