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)



Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do I have to do to make my code work with the security system?

477


Where is the value-type variables allocated in the computer ram?

433


Actually i downloaded Ajax news flash module but i am having issues enabling it on my site. need help.

1367


How do I add aspx page to visual studio?

473


What are the attributes of the

tags? What are their functions?

510






What is asp and how it works?

523


What does asp stand for in technology?

492


Explain how to refresh an asp page on a single click of a button?

458


what is the need of a sealed class when we are having a structure

1851


How do I open aspx files on windows 10?

515


Why .Net Does not Support multiple inheritance?

1625


Define microsoft intermediate language (msil)?

506


How to display images using response object?

531


Define an err object?

472


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

583