CHECK THE BELOW CODE
[CODE]
Imports System.Data.SqlClient
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
BindData()
End Sub
Sub BindData()
Dim strConn As String
strConn = "USER=ASDF;PASSWORD=ASDF;SERVER=ASD;DATABASE=ASDF"
Dim MySQL As String = "select A.Emp_Name,B.salary from emp A,salary B where A.emp_id=B.empid"
Dim MyConn As New SqlClient.SqlConnection(strConn)
Dim ds As DataSet = New DataSet()
Dim Cmd As New SqlClient.SqlDataAdapter(MySQL, MyConn)
Cmd.Fill(ds, "Emptbl")
Dim dt As New DataTable
dt = ds.Tables(0)
GridView1.DataSource = dt
GridView1.DataBind()
End Sub
End Class
[/CODE]
No comments:
Post a Comment
Plz Share your comments...