VB.Net Interview Questions and Answers
Question - 131 : - I Was Asked In Interview That If I Have Created A Class And I Don't Want The Class To Be Inherited By Any Other Members Without Me Which Key Or Function I Have To Use?
Answer - 131 : -
VB: for class NotInheritable [MyClass]
For method: NotOverridable [MyMethod]
C# For class or method :sealed[MyClassMyMethod]{}
Question - 132 : - How To Check For A Particular Record Whether It Is Present Or Not In Dataset
Answer - 132 : -
if the record is not present i want to display a message as no records what is the code for checking
if you are using "DataReader" then
if DataReaderName.HasRows then
statements
else
statements
end if
if you are using "DataSet" then
if DataSetName.TABLES.("tablename").ROWS.COUNT=0 THEN
statements.
end if
Question - 133 : - How To Store And Retrieve Images In Sql Server Database Through Vb.net?
Answer - 133 : -
To store image in database 1st u need to make table like this
CREATE TABLE PicImage
(
Picid int,
Pic Image
)
Now in vb.net coding u have to write code like this
Dim ms As New MemoryStream
pic_photo.Image.Save(ms, pic_photo.Image.RawFormat)
arrImage = ms.GetBuffer
ms.Flush()
Now pass arrImage in ur insert query.
Question - 134 : - What Is Different Between Web.config And Machine.config And Where It Will Be ?
Answer - 134 : -
The ASP.NET Web.config file is used to define the configuration settings for an ASP.NET application. ASP.NET and the .NET Framework use .config files to define all configuration options. The .config files, including the ASP.NET Web.config file, are XML files. The ASP.NET application configuration settings can be changed by creating a file called Web.config and saving it in the root folder of the application.This is how the minimal Web.config file should look like:
Question - 135 : - Can U Able To Get The Xml Document In Crystal Report If Yes How Its Possible?
Answer - 135 : -
Yes. You have to convert XML to dataset.
Question - 136 : - Differences Between Vb.net And C#, Related To Oops Concepts?
Answer - 136 : -
1. C# uses Must not Inherit, VB.Net uses sealed class
2. C# uses Internal, VB.Net uses Friend
3. VB.Net uses with events and end events
4. C# uses abstract and VB.Net uses Must Inherit
Question - 137 : - How Can I Extract The Formated Word(bold,italic,underline,font,color Etc) From The Msword File.?
Answer - 137 : -
using CommonDialog class
eg:
the code to invoke the default font dialog box by using the FontDialog control is given below:
private sub displayfont_click(byval sender as system.object, byval e as system.eventargs) handles displayfont .click fontdialog. showDialog()
textbox1.font=fontdialog1.font
end sub
the code to invoke the default font dialog box by instantiating the fontdialog class is:
dim fdialog as new fontdialog()
private sub displayfont_click(byval sender as system.object,byval e as system.eventargs) handles displayfont. click fdialog. showDialog()
textbox1.font=fontdialog1.font
end sub
Question - 138 : - How A Rotate A Control (rotation Like Shapes Are Rotated In Ms Powerpoint ) In Vb.net?
Answer - 138 : -
we can use adrotator control to use like powerpoint presentation.
Question - 139 : - How To Send Xml File On Server Using Http Protocol?
Answer - 139 : -
Through SOAP Protocol.
Question - 140 : - Whats The Difference Bt. .dll Extension And .exe Extension Files?
Answer - 140 : -
DLL : It is an inprocess server and runs in the same memory space as client application. Problem with dll is if any error comes in dll, whole application gets crashed.
Exe : It is an out of process server and rus as independent application in seperate memory. If error comes in exe, it does not affact the client application.