YouTube Icon

Interview Questions.

Top 21 Windows Forms Interview Questions - Jul 28, 2022

fluid

Top 21 Windows Forms Interview Questions

Q1. Suppose I Am Implementing One Windows Form. I Am Inserting Some Values Into Ms Access. In That Table five Columns There. But I Want To Insert Three Columns Only. When I Am Clicking Another Button Then Ot

First time insert five columns however two columns are empty  Value that’s null price when we click on some other button update  Query is used insert final columns (wherein circumstance Filled columns price).

Q2. What Are The New Events In Text Box That Has Been Included In Vb?

Validate occasion to manipulate.

Q3. What Is The Need Of Z-order Method?

Z order method is the use of the display the layout of the output shape to apply z order approach.

Z order method is Show view of the Z corner to print the z style.

Z order is Access the facts inside the two measurement Array to get right of entry to records

Ex:

1234

5678

9065

call Z order technique to skip order.

For ex: bypass three then output is 1396 to Access four corner of the z order.

Q4. Explain How To Net Forms The Windows?

Windows Forms: is the call given to the graphical application programming interface (API) included as a part of Microsoft .NET Framework, providing access to native Microsoft Windows interface elements through wrapping the extant Windows API in managed code.

Q5. How Save Rerecord In The Database?

Dim Query

Query="insert into Table_name(username)values('" & txt_username.Textual content & "')".

Dim cmd as sqlclient.Sqlcommand=new sqlclient.Sqlcommand(Query, connection) cmd.ExecuteNonquery().

Q6. Which Property Of Menu Cannot Be Set At Run Time?

Item assets cannot be set at runtime.

Q7. What Is The Difference Between List Index And Tab Index?

List index : This assets is used to test the index cost of the gadgets in the List container. 

Tab index : This belongings is used to set the flow of controls within the form whilst we press the tab button.

Q8. How Many Number Of Events Does The Timer Controls?

2 activities, one is disposed , 2nd one is tick event.

Q9. How To Find The Current Record Position In Data Control?

Absolute Position.

Q10. What Is The Difference Between List Box And Combo Box?

In List Box we ought to choose one among the option from the drop down listing. 

In Combo similar to radio button we should choose any individual.

Q11. Which Property Is Used To Lock A Text Box To Enter Data?

Textbox. Enabled = True;

This belongings is used to lock the textual content box to enter information.

Q12. How To Split A Column Header In Gridview Using C#.Net?

This can be finished at customer side, if u have a hard and fast format by, developing a html desk format in grid's "header template" and in item template.

Q13. Explain Something About Crystal Report In Brief?

Crystal Reports offers broad information connectivity alternatives  making it clean to get admission to corporation data and fulfill stop person data necessities.

If u want to use your personal SQL commands use the question era in Crystal Reports.

Q14. Where To Use New Keyword Other Than Create Instance?

Hiding of base magnificence method (non summary technique) may be accomplished just with the aid of giving an implementation inside the derived class. The "new" keyword is not vital. You can add the "new" key-word to save you a warning message in the course of compilation.

Q15. Explain How To Add Resources During Runtime?

Call the GetLocalResourceObject or GetLocalResourceObject technique to read unique sources from a worldwide or neighborhood resource file.

The GetLocalResourceObject approach takes the call of a resource elegance and the resource ID. The class call is based totally on the .Resx file call. For example, the document. WebResources.Resx, and all associated localized files, are referenced by using the magnificence name Web Resources.

The GetLocalResourceObject method takes a aid name representing a Resource Key property.

Button1.Text = GetLocalResourceObject("Button1.Text").ToString(); 

Button2.Text = (String)GetLocalResourceObject(

"WebResourcesGlobal", "Button2.Text");

A neighborhood default useful resource file stored inside the unique App_LocalResources folder is named in keeping with the ASP.NET web page. For example, if the subsequent code is used in a Default.Aspx page, the resource file should be named Default.Aspx.Resx. For this case, upload a string useful resource to this report named Button1.Text with the value "Found Resources".

A global default resource document that is saved inside the unique App_LocalResources folder is known as WebResourcesGlobal.Resx. Add a string aid named LogoUrl with the cost "Found Resources".

Q16. Suppose I Have Two Combo Box .. And I Have Some Items In Both Combo Box Now I Need To Check The Item In Both Combo Box If Same Item Is Present In Both Combo Box I Need To Display That Item In Message

For inti As Integer = 0 To ComboBox1.Items.Count 

For intj As Integer = zero To ComboBox2.Items.Count 

If ComboBox1.Items (inti).ToString = ComboBox2.Items (intj).ToString Then MessageBox.Show (ComboBox1.Items(inti))

End If

Next

Next

Q17. How To Get Records From A Database?

You ought to get the "dot internet motive force" of the database (or every other DataSource) you need to get admission to to.

For instance:

Mysql: Connector/Net

Access: Microsoft Access Driver

Oracle: Oracle Data Access Components (ODAC)

Afterwards you construct a connection string to tell your Program which driving force you want to use and where the dataSource can be observed.

For example:

Public const string DB_CONN_STRING = "Driver=Microsoft Access Driver (*.Mdb); "+  "DBQ=D: CSTestDbReadWriteSimpleTest.Mdb";

Afterwards you just must open a connection to the database the use of the previously created connection string and ship a question to the database to get the report:

ADO Connection conn = new ADO Connection (DB_CONN_STRING); 

Conn. Open (); 

ADODataReader dr;

ADO Command cmd = new ADO Command ( "SELECT * FROM

", Conn);

Cmd. Execute (out dr); 

whilst (dr.Read())

....

Q18. How To Create A Set Up In Vb.Net For Desktop Application Please Say Steps With Examples?

Goto file.

Add your undertaking by proper click on the task that u newly Created (In Solution Explorer).

Add Project output and localized resources by proper Clicking the existing project in answer explorer.

Finally build the project (Or) Take a Setup project from Visual Studio Deployment. Projects. By default you'll get. 

File System on Target Machine.

Different Editors in Setup undertaking:

File System on Target Machine.

Registry on Target Machine

File Types

User Interface

Custom Actions

@Launch Conditions

Q19. How Bar Code Create In The Report?

Take a barcode font like we used Arial, Time new Roman.

Install this font at window fonts listing.

Use Steric (*) at each ends of a subject of Report with the assist of double/unmarried commas. 

Change this area Font Like from Time new roman to barcode font.

E.G Bar is discipline that include digit from 1 to eight as proven below:

*12345678*

After changing font these digit were converted into Black 

Lines implyfive-Take print of barcode and revel in.

Q20. Write A Program To Create Login Form?

The following instance demonstrates the way to use a Login Control to offer a person interface to log on to a Web web site With square server database.

VB : Imports System. Data , Imports System.Data.SqlClient and Imports System.Web.Configuration , C# : using System. Data; , the use of  System.Data.SqlClient; and the use of System.Web.Configuration;

@xml record or net. Config

provider Name="System.Data.SqlClient"/>

@how-to-login-with-sq.-server-c.Aspx (Design Page)

<%@ Page Language="C#" AutoEventWireup="true" Code File="how-

to-login-with-sql-server-c.Aspx.Cs" 

Inherits="how_to_login_with_sql_server_c" %>

Transitional//EN" "http://www.W3.Org/TR/xhtml1/DTD/xhtml1-

transitional.Dtd">

a way to login with square server database:

Back Color="#FFFBD6" Border Color="#FFDFAD" Border Padding="four"

Border Style="Solid" Border Width="1px" Font-

Names="Verdana" Font-Size="zero.8em"

Fore Color="#333333" 

On Authenticate="Login1_Authenticate" TestLayout="TextOnTop"

Width="293px" 

Height="172px">

Bold="True" Font-Size="0.9em" 

Fore Color="White" />

Fore Color="Black" />

Border Color="#CC9966" Border Style="Solid" Border Width="1px"

Font-Names="Verdana" Font-Size="zero.8em" 

Fore Color="#990000" />

@how-to-login-with-sq.-server-c.Aspx.Cs (Code Behind 

C# Language) 

using System;

the use of System.Collections;

using System. Configuration;

the use of System. Data;

using System.Linq;

the use of System. Web;

the usage of System.Web.Security;

the usage of System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

the use of System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

the usage of System. Data;

the use of System.Data.SqlClient;

using System.Web.Configuration;

public partial elegance how_to_login_with_sql_server_c : 

System.Web.UI. Page

included void Login1_Authenticate(object sender, 

AuthenticateEventArgs e)

string username = Login1.UserName;

string pwd = Login1.Password;

string str Conn;

str Conn = WebConfigurationManager.ConnectionStrings

["ConnectionASPX"].Connection String;

SqlConnection Conn = new SqlConnection(strConn);

Conn. Open ();

String sqlUserName;

SqlUserName = "SELECT Username, Password FROM 

Username ";

SqlUserName += " WHERE (Username ='" + username 

+ "')";

SqlUserName += " AND (Password ='" + pwd + "')";

SqlCommand com = new SqlCommand (sqlUserName, Conn);

String Current Name;

Current Name = (string) com.ExecuteScalar ();

if (Current Name != null)

Session["User Authentication"] = username;

Session. Timeout = 1;

Response.Redirect("how-to-StartPage.Aspx");

else

Session["User Authentication"] = "";

Q21. How Insert Record In The Database?

Insert into <table_name> values (Parm1,parm2....).




CFG