Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically showing information

Status
Not open for further replies.

pink2070

Programmer
Jan 29, 2004
23
0
0
US
Is there a way of dynamically showing information from a sql server database in a web page without doing a postback.

My goal is to display information from a sql server database everytime the underlying table has received a change. I will also need to have the ability to format the cells based on the information being populated.

If anyone knows of any technology on this topic, or has attempted to do something similar please respond. Even if it's not quite what I'm looking for, the advice given may spin me in the right direction.

It is my belief that this may require creating this web page through a sql server wizard that offers the ability to watch the table for underlying changes. However I am not so sure about how I would then format the information displayed. Has anyone used this technology before?

 
I am not so sure about how I would then format the information displayed ..I havent tried this myself but maybe creating the fields to be displayed on the fly...

somone gave me this sample code but i havent tried it myself


Code:
<asplaceholder id="thisPlace" runat="server"/>

in code (and please keep in mind this is absolute bare bones):

Dim strSQL as String = "SELECT * FROM table" 'Uggg, better to write all the column names out
Dim objConn As System.Data.SqlClient.SqlConnection
Dim objComm As System.Data.SqlClient.SqlCommand
Dim ThisReader As System.Data.SqlClient.SqlDataReader
objConn = New System.Data.SqlClient.SqlConnection(GetConnectString())
objConn.Open()
objComm = New System.Data.SqlClient.SqlCommand("sql", objConn)
ThisReader = objComm.ExecuteReader()
If ThisReader.HasRows() Then
Dim i As Integer
For i = 0 To (ThisReader.FieldCount - 1)
Dim txtNew As New TextBox
txtNew.ID = ThisReader.GetName(i)
txtNew.Text = ThisReader.Item(i)
thisPlace.Controls.Add(txtNew)
Next
End If
ThisReader.Close()
objComm.Dispose()
objConn.Close()
 
Thank you eramGarden, but that code requires a postback. I am looking to display information onto a datagrid without doing a postback.

*This would be a sql server push
*or possible .net remoting

I am very new to this technology and any help is greatly appreciated. So I very much appreciate your response. Thank you.

If anyone else would like to take a stab at this I would be eternally greatful.

Thanks,

Pink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top