Admin page...............
Imports System.Data
Imports System.Data.SqlClient
Partial Class admin_Default
Inherits System.Web.UI.Page
Public con As SqlConnection
Public da As SqlDataAdapter
Public ds As DataSet
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
con = New SqlConnection("Data Source=OM;Initial Catalog=effort;Integrated Security=True")
da = New SqlDataAdapter("update page set p_title='" + TextBox1.Text + "',p_description='" + TextBox2.Text + "',dec='" + Editor1.Content.ToString + "'", con)
ds = New DataSet
da.Fill(ds)
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
client.................................
write namespace....
Function fill() As String
Try
con = New SqlConnection("Data Source=OM;Initial Catalog=effort;Integrated Security=True")
ds = New DataSet
da = New SqlDataAdapter("select * from page", con)
da.Fill(ds)
Label1.Text = ds.Tables(0).Rows(0).Item("dec")
Label2.Text = ds.Tables(0).Rows(1).Item("p_title")
Label3.Text = ds.Tables(0).Rows(2).Item("p_description")
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
fill()
End Sub
Imports System.Data
Imports System.Data.SqlClient
Partial Class admin_Default
Inherits System.Web.UI.Page
Public con As SqlConnection
Public da As SqlDataAdapter
Public ds As DataSet
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
con = New SqlConnection("Data Source=OM;Initial Catalog=effort;Integrated Security=True")
da = New SqlDataAdapter("update page set p_title='" + TextBox1.Text + "',p_description='" + TextBox2.Text + "',dec='" + Editor1.Content.ToString + "'", con)
ds = New DataSet
da.Fill(ds)
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
client.................................
write namespace....
Function fill() As String
Try
con = New SqlConnection("Data Source=OM;Initial Catalog=effort;Integrated Security=True")
ds = New DataSet
da = New SqlDataAdapter("select * from page", con)
da.Fill(ds)
Label1.Text = ds.Tables(0).Rows(0).Item("dec")
Label2.Text = ds.Tables(0).Rows(1).Item("p_title")
Label3.Text = ds.Tables(0).Rows(2).Item("p_description")
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
fill()
End Sub
No comments:
Post a Comment