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
Answer / niki
hmmmm ur posting tmv assignemnts questions.im laso from tmv
Is This Answer Correct ? | 45 Yes | 11 No |
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"/>
<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 |
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 |
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 |
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 |
What is the difference between ASP and HTML?
What is aspx cs file?
Explain the difference between cookies collection and form/querystring collection?
can we place Global.asa into "bin" directory instead of Root directory?
What is difference between Server.transfer and Response.redirect ?
What is server control
What is Extranet?
Is asp a language?
What is msmq?
Why does my code get a security exception when I run it from a network shared drive?
What are the advantages of asp?
What is a TextStream object?