Microsoft SQL Server 2005 Question NIIT (101-150)

Microsoft SQL Server 2005 Question NIIT (101-150)

101 You have to create an update trigger, trgMagic, on the EmployeeDepartmentHistory table. You want that whenever any update statement is fired on the EmployeeDepartmentHistory table, the trgMagic trigger is executed and displays the previous value in the table as well as the updated value. Which of the following statements would you use to perform the required task?
"1, CREATE TRIGGER [HumanResources].[trgMagic] ON
[HumanResources].[EmployeeDepartmentHistory] OF UPDATE AS
BEGIN
SELECT * FROM Deleted
SELECT * FROM Inserted 
END;"

"2, CREATE TRIGGER [HumanResources].[trgMagic] ON
[HumanResources].[EmployeeDepartmentHistory] FOR UPDATE AS
BEGIN
SELECT * FROM Deleted
SELECT * FROM Inserted
END;"

"3, CREATE TRIGGER [HumanResources].[trgMagic] ON
[HumanResources].[EmployeeDepartmentHistory] AFTER UPDATE AS
BEGIN
SELECT * FROM Deleted
SELECT * FROM Inserted
END;"

"4, CREATE TRIGGER [HumanResources].[trgMagic] ON
[HumanResources].[EmployeeDepartmentHistory]
INSTEAD OF UPDATE AS
BEGIN
SELECT * FROM Deleted
SELECT * FROM Inserted
END;"

3
102___________ is a set of functions that provide programmable logic used by client applications over the Internet.
1, Web service      2, Service-Oriented Architecture
3, HTTP              4, Personal Desktop Assistant

1
103___________ is an extension of distributed computing based on the request/reply design pattern.
1, Web service 2, Service-Oriented Architecture
3, HTTP         4, SOAP

2
104 To use the native XML Web services of the SQL Server, you need to establish an ______ endpoint at the server.
1, SOAP    2, WSDL 3, UDDI     4, HTTP

4
105 Which of the following database objects in the Service Broker architecture is an addressable endpoint for the conversations?
1, Message 2, Service 3, Contract 4, Queue

2
106 The Customer table in the database contains the information about the credit cards of the customers. You need to check whether the credit card number provided by the customer is valid. For this, you want to call a Web service. Which of the following options would you use to perform this task?
1, Managed database objects 2, Transaction 3, Stored procedure 4, Trigger

1
107 You have to create Service Broker objects in the AdventureWorks database. For this, you first need to enable Service Broker in the database. Which of the following statements can be used to enable Service Broker?
1, ALTER DATABASE AdventureWorks ENABLE_BROKER
2, ALTER AdventureWorks ENABLE_BROKER
3, ALTER DATABASE AdventureWorks ENABLE_SERVICE_BROKER
4, ALTER DATABASE AdventureWorks ENABLE_SERVICEBROKER

1
108 You have to create a message named myMessage that will be exchanged between the Service Broker services. The message will not be validated before sending. Which of the following statements can be used to create the message?
"1,CREATE MESSAGE TYPE myMessageVALIDATION = WELL_FORMED_XML"
2, CREATE MESSAGE TYPE myMessage
"3, CREATE MESSAGE TYPE myMessageVALIDATION = VALID_XML WITH SCHEMA COLLECTION"
"4, CREATE MESSAGE TYPE myMessageVALIDATION = EMPTY"

2
109 You have to implement Service Broker architecture between two services. For this, you have to create an agreement to define the messages that will be exchanged between the two services. Which of the following objects needs to be created to accomplish this?
1, MessageType    2, Contract    3, Service     4, Queue

2
110 Which of the following statements will you use to enable the CLR integration feature in the database?
"1, sp_configure CLR_ENABLED, 1;
GO
RECONFIGURE;
GO"
"2, sp_configure CLR ENABLED, 1;
GO
RECONFIGURE;
GO"
"3, sp_configure CLR_ENABLE, 1;
GO
RECONFIGURE;
GO"
"4, sp_configure ENABLE_CLR, 1;
GO
RECONFIGURE;
GO"

1
111 "You have created a .NET assembly named CLRIntegration.dll. You need to import this assembly in SQL Server database engine such that the .NET code is able to access any resource within or outside SQL Server. For this, you created the assembly object by using the following code:

CREATE ASSEMBLY CLRIntegration FROM
'C:\CLRIntegration.dll' WITH PERMISSION_SET = SAFE

However, the preceding code does not allow the .NET code to access any external resource. Analyze the preceding code and provide the correct solution."
"1, CREATE ASSEMBLY CLRIntegration FROM
'C:\CLRIntegration.dll' WITH PERMISSION_SET = ANY"
"2, CREATE ASSEMBLY CLRIntegration FROM
'C:\CLRIntegration.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS"
"3, CREATE ASSEMBLY CLRIntegration FROM
'C:\CLRIntegration.dll' WITH PERMISSION_SET = UNSAFE"
"4, CREATE ASSEMBLY CLRIntegration FROM
'C:\CLRIntegration.dll' WITH PERMISSION_SET = EXTERNAL"

3
112 "You have to create a contract to define an agreement between two services in SQL Server. The message type defined by this contract can be sent only by the endpoint that started the conversation. For this, you have used the following code:

CREATE CONTRACT sendContract
(
sendMessage SENT BY TARGET
);

However, the preceding code allows the message to be sent by the endpoint that is the target of the conversation. Analyze the problem and provide the correct solution."
"1, CREATE CONTRACT sendContract
(
sendMessage  BY INITIATOR
);"
"2, CREATE CONTRACT sendContract
(
sendMessage SENT BY INITIATOR ONLY
);"
"3, CREATE CONTRACT sendContract
(
sendMessage SENT BY ANY
);"
"4, CREATE CONTRACT sendContract
(
sendMessage SENT BY INITIATOR
);"

4
113 ___________ allows the database developers to create objects in any of the .NET-supported languages and embeds the objects in the database.
1, T-SQL 2, XML file 3, CLR integration 4, Functions

3
114 "You have created a procedure, getSalesDetails that returns a result set. You need to create an HTTP endpoint named sqlEndpoint to provide the getSalesDetails procedure as a Web method. For this, you used the following statement in SQL Server:

CREATE ENDPOINT sqlEndpoint
STATE = STARTED AS HTTP(
PATH = '/sql',
AUTHENTICATION = (INTEGRATED ),
PORTS = ( CLEAR ), SITE = 'SERVER' )
FOR SOAP (
WEBMETHOD 'getSqlInfo' (name='master.dbo.xp_msver', SCHEMA=STANDARD
),
WEBMETHOD 'getSalesDetails' (name='master.sys.fn_MSdayasnumber'),
WSDL = DEFAULT, SCHEMA = STANDARD, DATABASE = 'master', NAMESPACE =
'http://tempUri.org/' );

However, when the preceding statement is executed, the following error is displayed:

Msg 7890, Level 16, State 1, Line 1

Identify the reason for this error and provide the correct solution."
"1, This error occurs when the port 8080 is being used by some other service and is not free to host any other service. To resolve the error, you need to use the following statement:PORTS = ( CLEAR ), Clear_Port = 8080, SITE = 'localhost' )"

"2, This error occurs when the authentication type used is INTEGRATED. To resolve the error, you need to use the following statement:AUTHENTICATION = (BASIC)"

"3, This error occurs when an inline XSD schema will be returned for the current Web method in the SOAP responses. To resolve the error, you need to use the following statement:
SCHEMA= NONE"

"4, This error occurs when the WSDL document generation is not supported for this endpoint. To resolve the error, you need to use the following statement:
WSDL = NONE"

1
115 "You have to create a service to be used by Service Broker to deliver messages to the correct queue within a database. The service will store all the messages in the queue named sendQueue.  The contract for this service will be sendContract. To create the service, you used the following statement:

CREATE SERVICE sendService
ON QUEUE
(sendContract) [dbo].[sendQueue] 

However, the preceding statement displays a syntactical error. Analyze the statement and provide the correct solution."
"1, CREATE SERVICE sendService
ON QUEUE
[dbo].[sendQueue] (sendContract)"
"2, CREATE SERVICE sendService
ON QUEUE
[dbo].[sendQueue] CONTRACT (sendContract)"
"3, CREATE SERVICE sendService
ON QUEUE
[dbo].[sendQueue]"
"4, CREATE SERVICE sendService
ON CONTRACT
(sendContract) [dbo].[sendQueue]"

1
116 "You have to create a managed stored procedure to store the employee details in an XML file. For this, you have created the ConvertXML.dll assembly and registered it in SQL Server with the name ConvertXMLAssembly. The code for ConvertXML.dll assembly is:

namespace CLRStoredProcedure
{
    public class XMLProc
    {
       public static void convXml()
       {
         ??.
       }
    }
}

Now, you have to create a stored procedure and associate it with the convXML() method contained in the ConvertXML.dll assembly. For this, you have used the following statement:

CREATE PROCEDURE clrproc AS EXTERNAL NAME
ConvertXML.[CLRStoredProcedure.XMLProc].convXml

Analyze the scenario and identify whether the preceding statement will create the required managed stored procedure. If not, provide the correct solution."
1, There is no error in the code and managed stored procedure will be createdsuccessfully.
"2, No, the correct statement to create the managed stored procedure is:
CREATE PROCEDURE clrproc AS EXTERNAL NAME CLRStoredProcedure.XMLProc.convXml"
"3, No, the correct statement to create the managed stored procedure is:CREATE PROCEDURE clrproc AS EXTERNAL NAME ConvertXML.XMLProc.convXml"
"4, No, the correct statement to create the managed stored procedure is:CREATE PROCEDURE clrproc AS EXTERNAL NAME ConvertXMLAssembly.[CLRStoredProcedure.XMLProc].convXml"

4
117 "Consider the following code for the CalcSal.dll assembly:

namespace EmployeePay
{
    public class Pay
    {
       public static SqlString calcSalary(SqlString emp)
       {
         ??.
       }
    }
}

You have imported the preceding assembly in SQL Server database engine by the name CalcSalAssembly. Now, you have to create a managed function named SalaryCalculation that will refer to the calcSalary() method of the preceding assembly. Which of the following statements would you use to create the managed function?"
"1, CREATE FUNCTION SalaryCalculation(@EmpID as nVarchar(3))
AS EXTERNAL NAME CalcSalAssembly.[EmployeePay.Pay].calcSalary"
"2, CREATE FUNCTION SalaryCalculation RETURNS nVarchar
AS EXTERNAL NAME CalcSalAssembly.[EmployeePay.Pay].calcSalary"
"3, CREATE FUNCTION SalaryCalculation(@EmpID as nVarchar(3)) RETURNS nVarchar(10)
AS EXTERNAL NAME CalcSal.[EmployeePay.Pay].calcSalary"
"4, CREATE FUNCTION SalaryCalculation(@EmpID as nVarchar(3))RETURNS nVarchar(10) 
AS EXTERNAL NAME CalcSalAssembly.[EmployeePay.Pay].calcSalary"

4
118 "The UserNameAudit table in the database stores various details of the users including the E-mail address. While inserting the users details, you need to validate the E-mail address to ensure that it is a valid E-mail address. You have created the ValidateMail.dll assembly to implement the logic of validating the E-mail address. The code of ValidateMail.dll assembly is:

public class trgMail
{
  public static void MailValid()
  {
   // Write the logic of validating the e-mail address
  }    
}

You have imported the preceding assembly in SQL Server database engine by the name ValidateEmailAssembly. Now, you have to create a trigger that will refer to the MailValid() method of the preceding assembly. Which of the following statements would you use to create the managed trigger?"
"1, CREATE TRIGGER EmailValidation OF INSERT ON UserNameAudit
AS EXTERNAL NAME ValidateEmailAssembly.trgMail.MailValid"

"2, CREATE TRIGGER EmailValidation ON UserNameAudit FOR INSERT
AS EXTERNAL NAME ValidateEmailAssembly.trgMail.MailValid"

"3, CREATE TRIGGER EmailValidation FOR INSERT ON UserNameAudit
AS EXTERNAL NAME ValidateEmailAssembly.trgMail.MailValid"

"4, CREATE TRIGGER EmailValidation ON UserNameAudit FOR INSERT
AS EXTERNAL NAME ValidateEmailAssembly.trgMail"

2
119 You have to implement Service Broker architecture in the database engine to create services that converse with each other by sending and receiving messages. For this, you have created the message type. Now, you need to create a queue object that is available to receive messages. Which of the following statements would you use to accomplish this task? 1, CREATE QUEUE sendQueue WITH STATUS = ON
2, CREATE QUEUE sendQueue WITH STATUS = OFF RETENTION = ON
3, CREATE QUEUE sendQueue WITH ACTIVATION = ON
4, CREATE QUEUE sendQueue WITH ACTIVATION = ON RETENTION = ON

1
120 You have to implement Service Broker architecture in the database engine to create services that converse with each other by sending and receiving messages. For this, you have created two services, sendMessage and receiveMessage services. Now, you need to begin a conversation between the sendMessage and receiveMessage services by using the sendContract contract. Which of the following statements would you use to accomplish this task?
"1, DECLARE @dialog_handle UNIQUEIDENTIFIER;BEGIN DIALOG CONVERSATION @dialog_handle FROM
SERVICE [sendMessage] TO SERVICE 'receiveMessage' ON CONTRACT [sendContract];"

"2, DECLARE @dialog_handle;BEGIN DIALOG CONVERSATION @dialog_handle FROM
SERVICE [sendMessage] TO SERVICE 'receiveMessage' ON CONTRACT [sendContract];"

"3, DECLARE @dialog_handle UNIQUEIDENTIFIER;BEGIN DIALOG CONVERSATION @dialog_handle FROM
SERVICE [sendMessage] TO SERVICE 'receiveMessage' ON [sendContract] CONTRACT;"

"4, DECLARE @dialog_handle UNIQUEIDENTIFIER;BEGIN CONVERSATION @dialog_handle FROM
SERVICE [sendMessage] TO SERVICE 'receiveMessage' ON CONTRACT [sendContract];"

1
121 You have to implement Service Broker architecture in the database engine to create services that converse with each other by sending and receiving messages. For this, you have created all the required broker objects and started the conversation. Now, you need to send and receive messages. Which of the following statements would you use to send a message named sendMessage?
"1, SEND ON CONVERSATION@dialog_handle FOR MESSAGE TYPE [sendMessage]('<name>John</name>')"
"2, SEND ON CONVERSATION@dialog_handle MESSAGE TYPE [sendMessage]('<name>John</name>')"
"3, SEND ON CONVERSATION@dialog_handle MESSAGE [sendMessage]('<name>John</name>')"
"4, SEND ON CONVERSATION@dialog_handle FOR MESSAGE [sendMessage]('<name>John</name>')"

2
122 Which of the following components of the .NET Framework provides the various services, such as code compilation, memory allocation, and garbage collection?
1, Common Language Runtime 2, Windows Forms
3, .NET framework base classes     4, ASP.NET

1
123 Which of the following properties of a form is used to specify whether a form will be displayed as a normal, maximized, or minimized window on startup?
1, Size     2, StartPosition 3, WindowState    4, Text

3
124 Which of the following events of a Windows form occurs when the form loses focus and is no longer active?
1, Deactivate 2, FormClosed 3, Click 4, Load

1
125 Which of the following properties of the ListBox control can be set at design time as well as at run time?
1, Sorted 2, SelectionMode 3, SelectedIndex 4, SelectedItem

2
126 Which of the following controls allows the user to select an option from the given list and also allows him to type new text in it?
1, LinkLabel Control 2, TextBox Control 3, ComboBox Control 4, ListBox Control

3
127 Which of the following properties of the GroupBox control is used to specify the caption to be displayed for the control?
1, DocumentTitle 2, Value 3, Text       4, Font

3
128_____________ function is used to convert char to int data type.
1, Parse.ToInt32 2, DateTime.Parse
3, Convert.ToInt32 4,Convert.ToDateTime

3
129 You cannot create an instance of the __________ by using the new keyword.
1, ErrorProvider Class 2, MessageBox Class
3, ToolStrip Class 4, StatusStrip Class

2
130 You are working as an application developer in CompSol Inc. You are asked to create a Windows-based application that should have a single Form. The Form should contain multiple controls to take input from user. After creating the application, you compiled it. During compilation, you encountered few errors in your code. Which of the following steps you need to perform to view error details?
1, Select Debug-->Windows-->Breakpoints from the Menu bar.
2, Select Window-->Error List from the Menu bar.
3, Select Debug-->Exceptions from the Menu bar.
4, Select View-->Error List from the Menu bar.

4
131 You are working as an application developer in CompSol Inc. You are asked to develop a Windows-based application for a grocery shop. The application should allow the user to select a grocery item from the list of items. Which of the following code snippets, you need to write in your application to create the list of grocery items?
"1, .....................
.....................
listBox1.Items.Add(""Rice"");
listBox1.Items.Add(""Flour"");
...............................
........................................."

"2, ....................
......................
listBox1.Add(""Rice"");
listBox1.Add(""Flour"");
......................................
.................................."

"3, ....................
......................
comboBox1.Items.Add(""Rice"");
comboBox1.Items.Add(""Flour"");
......................................
.................................."

"4, ....................
......................
comboBox1.Add(""Rice"");
comboBox1.Add(""Flour"");
......................................
.................................."

1
132 You are working as an application developer in ABC Corp. You are asked to create a Windows-based application for a school to gather the information about the students taking admission in the school. The application should have a Form to enter the information about the students. The Form should have a button control that should allow the user to submit the information. You need to provide an appropriate caption to the button control. Identify the code snippet that should be used in your application to accomplish the desired task.
1, button1.Text = "Submit Details"; 2, button1.Name = "Submit Details";
3, button1.Tag = "Submit Details"; 4, button1.TextAlign = "Submit Details";

1
133 "You are working as an application developer in InfoSol Inc. You are asked to develop a Windows-based application for a grocery store. The application should have an interface that should take the bill amount of the customers as input. If the bill amount is greater than 500 dollars, a button control must be added to the Interface. The click event of the button control should use Next() method of System.Random class to generate the discount amount between 5% and 35% for the customers who have made purchases more than 500 dollars. The customers must be greeted with an appropriate message.
Identify the correct code to accomplish the desired task."
"1, public partial class Form1 : Form
    {
        int BillAmount;
        Button btn = new Button();
        public Form1()
        {
            InitializeComponent();
            btn.Click += new EventHandler(btn_Click);
         }
        private void btn_Click(object sender, EventArgs e)
        {
            Random rnd = new Random();
            int x = rnd.Next(5,35);
            MessageBox.Show(""Congratulations!!!!! You get ""+x+""% discount"");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BillAmount = Convert.ToInt32(textBox1.Text);
            if (BillAmount > 500)
            {
                btn.Text = ""Click Me"";
             }
        }                
    }"
"2, public partial class Form1 : Form
    {
        int BillAmount;
        Button btn = new Button();
        public Form1()
        {
            InitializeComponent();
          
         }
        private void btn_Click(object sender, EventArgs e)
        {
            Random rnd = new Random();
            int x = rnd.Next(5,35);
            MessageBox.Show(""Congratulations!!!!! You get ""+x+""% discount"");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BillAmount = Convert.ToInt32(textBox1.Text);
            if (BillAmount > 500)
            {
                btn.Text = ""Click Me"";
                this.Controls.Add(btn);
            }
        }                
    }"
"3, public partial class Form1 : Form
    {
        int BillAmount;
       
        public Form1()
        {
            InitializeComponent();
            btn.Click += new EventHandler(btn_Click);
         }
        private void btn_Click(object sender, EventArgs e)
        {
            Random rnd = new Random();
            int x = rnd.Next(5,35);
            MessageBox.Show(""Congratulations!!!!! You get ""+x+""% discount"");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BillAmount = Convert.ToInt32(textBox1.Text);
            if (BillAmount > 500)
            {
                btn.Text = ""Click Me"";
                this.Controls.Add(btn);
            }
        }                
    }" "
4, public partial class Form1 : Form
    {
        int BillAmount;
        Button btn = new Button();
        public Form1()
        {
            InitializeComponent();
            btn.Click += new EventHandler(btn_Click);
         }
        private void btn_Click(object sender, EventArgs e)
        {
            Random rnd = new Random();
            int x = rnd.Next(5,35);
            MessageBox.Show(""Congratulations!!!!! You get ""+x+""% discount"");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BillAmount = Convert.ToInt32(textBox1.Text);
            if (BillAmount > 500)
            {
                btn.Text = ""Click Me"";
                this.Controls.Add(btn);
            }
        }                
    }"

4
134 You are working as an application developer in CompSol Inc. You are asked to create a Windows based application that should have the login form. The application should allow the user to create their login ID. You need to add a validation check on the TextBox control that takes the password from the user. An appropriate message should be shown to the user if the length of the password is less than 6 characters. Which of the following code snippet you need to add to your application code to accomplish the task.
"1, private void textBox1_Validating(object sender, CancelEventArgs e)
        {
            if(textBox1.Text.Length<=6)
            {
                MessageBox.Show(""Length of the Password is not valid"");
        }"
"2, private void textBox1_Validating(object sender, CancelEventArgs e)
        {
            if(Convert.ToInt32(textBox1.Text)<6)
            {
                MessageBox.Show(""Length of the Password is not valid"");
        }"
"3, private void textBox1_Validating(object sender, CancelEventArgs e)
        {
            if(Convert.ToDateTime(textBox1.Text.Length)<6)
            {
                MessageBox.Show(""Length of the Password is not valid"");
        }"
"4, private void textBox1_Validating(object sender, CancelEventArgs e)
        {
            if(textBox1.Text.Length<6)
            {
                MessageBox.Show(""Length of the Password is not valid"");
        }"

4
135 You are developing a Windows-based application that creates the multiple objects of the Button class at run time. Which of the following components of the .NET Framework allocate memory to these objects?
1, ASP.NET       2, .NET Framework base classes
3, JIT Compiler        4, Common Language Runtime

4
136 You are creating a Windows-based application. You need to drag multiple controls from the Toolbox window to the Form control. For your convenience, you want the Toolbox window to be opened permanently. Which of the following features of Visual Studio .NET IDE you need to modify?
1, Floating 2, Auto hide 3, Tabbed navigation 4, Docking

2
137 You are asked to create a Windows-based application. The form of the application must appear at the centre of the screen when application is executed. Which of the following properties you need to set to accomplish the desired task?
1, Size     2, StartPosition 3, WindowState      4, BackgroundImage

2
138 You are asked to create a Windows-based application. The form present in the application when gets the focus at run time should come to the front of other applications or its caption should flash on the task bar. Which of the following methods you need to use to accomplish the desired task?
1, Activate() 2, SetDesktopLocation()      3, Show()     4, Close()

1
139 Which of the following controls is a container control?
1, Dialog Box Control 2, Label Control 3, Button Control 4, Textbox Control

1
140 __________ is a process by which an application in the Windows environment is able to link to library functions at run time.
1, Static linking 2, Dynamic linking 3, Execution 4, Compilation

2
141 Which of the following types of CommonDialog classes can be used to change the size of the text in the Windows-based application?
1, ColorDialog Class 2, FontDialog Class 3, FileDialog Class 4, PrintDialog Class

2
142 Which of the following properties is used to create an MDI parent form?
1, MergeIndex 2, MergeAction 3, ActiveMdiChild 4, IsMdiContainer

4
143 Which of the following classes is used for printing the text as well as graphics? 1, PrintPageEventArgs Class 2, PrintDialog Class
3, Graphics Class 4, PrintDocument Class

4
144 The ______________ is used to display the Print Setup page on the screen by using the ShowDialog() method.
1, PageSetupDialog class 2, PageSettings class
3, PrintDialog class 4, PrintDocument class

1
145 Which of the following control properties specifies the use of an element in the user interface and reports it to accessibility aids?
1, AccessibleName 2, AccessibleDescription 3, AccessibleRole 4, TabIndex

3
146 You are working as an application developer in CompSol Inc. You are asked to create a Windows based application for children. Through the application, children will be able to learn about the color combinations. Your interface should have one TextBox control and two Button controls required to set the background and foreground color of the text written in the TextBox control. Your application should use the ColorDialog control to invoke the default Color dialog box. Identify the correct code snippet that you need to add to your application.
"1, private void Background_Click(object sender, EventArgs e)
        {
            ColorDialog colorDialog1 = new ColorDialog();
            colorDialog1.ShowDialog();
            textBox1.BackColor = colorDialog1.Color;
        }

        private void Foreground_Click(object sender, EventArgs e)
        {
            ColorDialog colorDialog2 = new ColorDialog();
            colorDialog2.ShowDialog();
            textBox1.ForeColor = colorDialog1.Color;
        }"
"2, ColorDialog CDialog;
        private void Background_Click(object sender, EventArgs e)
        {
            CDialog.ShowDialog();
            textBox1.BackColor = CDialog.Color;
        }
        private void Foreground_Click(object sender, EventArgs e)
        {
            CDialog.ShowDialog();
            textBox1.ForeColor = CDialog.Color;
        }"
"3, private void Background_Click(object sender, EventArgs e)
        {
            colorDialog1.ShowDialog();
            textBox1.BackColor = colorDialog1.Color;
        }

        private void Foreground_Click(object sender, EventArgs e)
        {
            colorDialog1.ShowDialog();
            textBox1.ForeColor = colorDialog1.Color;
        }"
"4, ColorDialog CDialog = new ColorDialog();
        private void Background_Click(object sender, EventArgs e)
        {
            CDialog.ShowDialog();
            textBox1.BackColor = CDialog.Color;
        }
        private void Foreground_Click(object sender, EventArgs e)
        {
            CDialog.ShowDialog();
            textBox1.ForeColor = CDialog.Color;
        }"

3
147 You are working as an application developer in InfoSol Inc. You are asked to create a Windows-based application for a school. The application should enable the user to enter the data in the Student Details forms. The Student Details form should have a menu item named Print, which should get merged with the main MDI parent form menu. When the user clicks the Student Details form, the Student Details form should be displayed. The user should be able to close the application by clicking the Exit menu item. Identify the correct sequence of tasks that you need to perform to create the application.
"1, 1. Create a new VC# application.
2. Design the menu on the MDI parent form.
3. Convert the form to the MDI parent form.
4. Design the Student Details entry form.
5. Create the Print menu on the Student Details entry form.
6. Add code to MDI parent form and Student Details entry form.
7. Execute the application and verify the output."

"2, 1. Create a new VC# application.
2. Convert the form to the MDI parent form.
3. Design the menu on the MDI parent form.
4. Add code to MDI parent form and Student Details entry form.
5. Design the Student Details entry form.
6. Create the Print menu on the Student Details entry form.
7. Execute the application and verify the output."

"3, 1. Create a new VC# application.
2. Convert the form to the MDI parent form.
3. Design the menu on the MDI parent form.
4. Design the Student Details entry form.
5. Create the Print menu on the Student Details entry form.
6. Add code to MDI parent form and Student Details entry form.
7. Execute the application and verify the output."

"4, 1. Create a new VC# application.
2. Convert the form to the MDI parent form.
3. Add code to MDI parent form and Student Details entry form.
4. Design the menu on the MDI parent form.
5. Design the Student Details entry form.
6. Create the Print menu on the Student Details entry form.
7. Execute the application and verify the output."

3
148 You are working as an application developer in InfoSol Inc. You are asked to create a Window-based application that should allow the user to type in the content and then print it. Your application should use the PrintDialog and PrintDocument controls to invoke the default Print dialog box. Identify the correct code that you need to add to your application.
"1, private void Print_Click(object sender, EventArgs e)
        {
            printDialog1.Document = printDocument1;
            DialogResult result = printDialog1.ShowDialog();
            if (result == DialogResult.OK)
                printDocument1.Print();
        }
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString(textBox1.Text, new Font(""Arial"",40, FontStyle.Bold), Brushes.Black, 150, 125);
        }"
"2, private void Print_Click(object sender, EventArgs e)
        {
            printDialog1.Document = printDocument1;
            if (result == DialogResult.OK)
                printDocument1.Print();
        }
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString(textBox1.Text, new Font(""Arial"",40, FontStyle.Bold), Brushes.Black, 150, 125);
        }"
"3, public partial class Form1 : Form
    {
        PrintDialog pdlg = new PrintDialog();
        internal PrintDocument PDocument = new PrintDocument();
        public Form1()
        {
            InitializeComponent();
        }
        private void Print_Click(object sender, EventArgs e)
        {
            pdlg.Document = PDocument;
            DialogResult result = pdlg.ShowDialog();
            if (result == DialogResult.OK)
                PDocument.Print();
        }
        private void PDocument_PrintPage(object sender,System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString(textBox1.Text, new Font(""Arial"", 40,
            FontStyle.Bold), Brushes.Black, 150, 125);
        }    }"
"4, public partial class Form1 : Form
    {
        PrintDialog pdlg = new PrintDialog();
        internal PrintDocument PDocument = new PrintDocument();
        public Form1()
        {
            InitializeComponent();
        }
        private void Print_Click(object sender, EventArgs e)
        {
            pdlg.Document = PDocument;
            if (result == DialogResult.OK)
                PDocument.Print();
        }
        private void PDocument_PrintPage(object sender,System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString(textBox1.Text, new Font(""Arial"", 40,
            FontStyle.Bold), Brushes.Black, 150, 125);
        }    }"

1
149 You are working as an application developer in InfoSol Corp. You are asked to create a Window-based application that should implement the concept of globalization. The application should have an interface to provide the information about culture settings of the system on which the application is running. The information should be available on the message box when the user clicks the button. Identify the code that you need to add to the click event of the button control.
"1, private void button1_Click(object sender, EventArgs e)
        {
            CultureInfo myCulture;
            myCulture = CurrentCulture;
            MessageBox.Show(""Your Culture Info is:""+"" ""+myCulture.ToString());
        }"
"2, private void button1_Click(object sender, EventArgs e)
        {
            CultureInfo myCulture;
            myCulture = CultureInfo.CurrentCulture();
            MessageBox.Show(""Your Culture Info is:""+"" ""+myCulture.ToString());
        }"
"3, private void button1_Click(object sender, EventArgs e)
        {
            CultureInfo myCulture = new CultureInfo();
            myCulture = CultureInfo.CurrentCulture;
            MessageBox.Show(""Your Culture Info is:""+"" ""+myCulture.ToString());
        }"
"4, private void button1_Click(object sender, EventArgs e)
        {
            CultureInfo myCulture;
            myCulture = CultureInfo.CurrentCulture;
            MessageBox.Show(""Your Culture Info is:""+"" ""+myCulture.ToString());
        }"

4
150 You are working as an application developer in Infosol Corp. You are asked to create a Windows-based application that should have Pop-up help for displaying tips for the controls present in the application. Identify the correct steps that you need to perform for enabling the Pop-up help in a form present in the application.
"1, 1. Set the MinimizeBox property of the form to True.
2. Set the MaximizeBox property of the form to False.
3. Set the HelpButton property of the form to True.
4. Add a HelpProvider control to the form."

"2, 1. Set the MinimizeBox property of the form to False.
2. Set the MaximizeBox property of the form to True.
3. Set the HelpButton property of the form to True.
4. Add a HelpProvider control to the form."

"3, 1. Set the MinimizeBox property of the form to True.
2. Set the MaximizeBox property of the form to True.
3. Set the HelpButton property of the form to False.
4. Add a HelpProvider control to the form."

"4, 1. Set the MinimizeBox property of the form to False
2. Set the MaximizeBox property of the form to False.
3. Set the HelpButton property of the form to True.
4. Add a HelpProvider control to the form."

4

Post a Comment

Previous Post Next Post