1)Declare array with five elements
a[]={8,4,6,2,1,10}
Print minimum and maximum no from array.

2)Accept values from Textbox and add into Listbox on click
ok button.












2)Accept these values store them in cookie collection and
show them in next form.










Assignment 3 20Marks
1) Display EmpId ,EmpName ,EmpSal usind datagrid view
(use sqlerver 2005)

2) Insert Item Id, Item Name, Qty, Rate using ado.net(use
sqlerver 2005)



Answers were Sorted based on User's Feedback



1)Declare array with five elements a[]={8,4,6,2,1,10} Print minimum and maximum no from array. ..

Answer / niki

hmmmm ur posting tmv assignemnts questions.im laso from tmv

Is This Answer Correct ?    45 Yes 11 No

1)Declare array with five elements a[]={8,4,6,2,1,10} Print minimum and maximum no from array. ..

Answer / shivprasad

1)textbox 2 listbox

<%@ Page Language="VB" %>
<script runat ="server">
Sub Add_Item(ByVal Source As Object, ByVal e As
EventArgs)
Dim str As String
str = text1.Text
List.Items.Add(str)
text1.Text = ""
End Sub
</script>

<html>
<head>
<title>Untitled Page</title>
</head>
<body bgcolor="aqua">
<form id="form1" runat="server">
<center><h2>
<asp:Label ID="Label1" Text ="Adding Items In ListBox"
runat="server"/>
</h2></center>
<br/><br/><br/><br/>
<asp:Label ID="Label2" Text ="Enter Text :"
runat="server"/>
<asp:Textbox ID="text1" runat="server"/>
<asp:RequiredFieldValidator ID = "R" ControlToValidate
= "text1" Text = "Enter Text First" runat
= "server"/>&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="B" OnClick = "Add_Item" text = "
OK " runat= "server"/>
<br/><br/>
<asp:Listbox ID="List" rows = "10" runat= "server"/>
</form>
</body>
</html>

Is This Answer Correct ?    20 Yes 0 No

1)Declare array with five elements a[]={8,4,6,2,1,10} Print minimum and maximum no from array. ..

Answer / aparna

first answer is
we can use sort() method to call for displaying min to max
integers

second one
very simple method just pass the text box value to the list
box in button click even

Is This Answer Correct ?    15 Yes 3 No

1)Declare array with five elements a[]={8,4,6,2,1,10} Print minimum and maximum no from array. ..

Answer / sangram singh thakur(t.y.b.c.a

assignment 3-2


<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script runat=server>
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
Dim DBConn as SQLConnection
Dim DBAdd As New SQLCommand
' DBConn = New SQLConnection("server=localhost;" _
' & "Initial Catalog=TT;" _
' & "User Id=sa;" _
' & "Password=yourpassword;")
DBConn = New SQLConnection("Data Source=whsql-
v08.prod.mesa1.secureserver.net;Initial
Catalog=DB_49907;User ID=java2suser;Password='password';")
DBAdd.CommandText = "Insert Into Employee (" _
& "LastName, FirstName, Salary " _
& ") values ('" & txtLastName.Text & "'," _
& "'" & txtFirstName.Text _
& "'," & txtSalary.Text & ")"

DBAdd.Connection = DBConn
DBAdd.Connection.Open
DBAdd.ExecuteNonQuery()
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Adding SQL Server Data</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<BR>
Last Name:
<BR>
<asp:textbox id="txtLastName" runat="Server"/>
<BR>
First Name:
<BR>
<asp:textbox id="txtFirstName" runat="Server"/>
<BR>
Salary:
<BR>
<asp:textbox id="txtSalary" runat="Server"/>
<BR><BR>
<asp:button id="butOK" text="OK" onclick="SubmitBtn_Click"
runat="server"/>
</form>
</BODY>
</HTML>

Is This Answer Correct ?    11 Yes 2 No

1)Declare array with five elements a[]={8,4,6,2,1,10} Print minimum and maximum no from array. ..

Answer / shivprasad (9270595151)

2) Accept 2 no's from user & uning while loop calculate A^B
ans :
<%@ Page Language="VB" %>
<script runat ="server">
Sub Clear_Text(ByVal Source As Object, ByVal e As
EventArgs)
Text1.Text = ""
Text2.Text = ""
End Sub

Sub Calculate(ByVal Source As Object, ByVal e As
EventArgs)
Dim num1 As Integer
Dim num2 As Integer

num1 = CInt(Val(Text1.Text))
num2 = CInt(Val(Text2.Text))

Dim result As Long = 1
While num2 > 0
result *= num1
num2 -= 1
End While
MsgBox("The Value of A ^ B Is " & result)
End Sub
</script>

<html>
<head>
<title>Untitled Page</title>
</head>
<body bgcolor="aqua">
<form id="form1" runat="server">
<asp:Label ID="Label1" Text ="Enter No A :"
runat="server"/>
<asp:TextBox ID="Text1" runat="server"/>
<asp:RequiredFieldValidator ID ="R1" ControlToValidate
= "Text1" Text = "Enter The Number" runat = "server" />
<br/>
<asp:Label ID="Label2" Text ="Enter No B :"
runat="server"/>
<asp:TextBox ID="Text2" runat="server"/>
<asp:RequiredFieldValidator ID ="R2" ControlToValidate
= "Text2" Text = "Enter The Number" runat = "server" />
<br/><br/><br/>
<asp:Button ID = "ok" Text = "OK" OnClick = "Calculate"
runat ="server"/>
<asp:Button ID = "clear" Text = "Clear" OnClick
= "Clear_Text" runat ="server"/>
</form>
</body>
</html>

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More ASP Interview Questions

What are server-side includes?

0 Answers  


Define asp?

0 Answers  


what is differance b/w .net assemblies and com component?

3 Answers  


Define extranet?

0 Answers  


How does VaryByCustom work?

0 Answers  






Name the methods in session object?

0 Answers  


The FileSystemObject provides an object interface to drives, directories, and files for which of the following? A. Any local or mapped drive on either the server or the client. B. Only files and subdirectories in the web site's home directory. C. Any local physical drive or mapped drive on the web server. D. Any file system physically located on the web server. E. The client's computer.

1 Answers  


Define a dictionary object?

0 Answers  


Which asp object is often used to retrieve user information from forms?

0 Answers  


What is the difference between server-side validation and client-side validation?

0 Answers  


Explain the post and get method or explain the difference between them?

0 Answers  


What are the methods by which output stream is controlled?

1 Answers  


Categories