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

Who is asp in police?

0 Answers  


How to display images using response object?

0 Answers  


Explain the difference between the value-type variables and reference-type variables in terms of garbage collection?

0 Answers  


What is Request Object?

2 Answers  


Can I avoid using the garbage collected heap?

0 Answers  






I have all files relating one project in ASP.... I want to make a Localhost for running like website........

2 Answers  


How can you change the primary scripting language for a page?

0 Answers  


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

0 Answers  


Tell something about Active Server Pages?

5 Answers   Microsoft,


What is asp what can asp do for you?

0 Answers  


What is the difference between html and asp?

0 Answers  


What is Response object? How is it related to ASP's Response object?

0 Answers   MCN Solutions,


Categories