Showing posts with label tables. Show all posts
Showing posts with label tables. Show all posts

Saturday, March 31, 2012

submitting the form to the browser

I am very new to ASP.NET. We have an asp.NET project that is used to show the state of various sql tables/data. The "proposed enhancement" to that is when the data is updated locally (through another application running on the same network where the database is located), the browser (if someone happen to view the same data over the Internet through a browser) should refresh automatically so that the data is ~accurate~ when viewed. I know that browser uses pull technology, and in order to receive a new data, the browser must "request" it (through a control-generated event or a refresh event generated through timer). When the form is posted back to the server and resubmitted, it will "refresh" the browser view. Since the data must appear on the browser within 10-20 seconds of the actual data update, the refresh must be done quite frequently, and the page will constantly reload, so because of that I am not eager to generate refresh events on timer. Is there any way I can push the newly updated page to the browser from the server without any interaction/request from the browser? Is anybody aware of any other technology that I can use it to accomplish this task? ANy help/hint/suggestions are greatly appreciated.

Thank you
olaHi ola,

Unfortunately, there is no other technology that will help you with this issue. You are correct in that the brower uses "pull" technology and therefore there is nothing you can do on the server side to initiate this refresh. The only solution is to use client-side script to refresh the borwser.

Chad
Hi ola,

unfortunately a browser only supports the pull way. But maybe this article can be of help to you:Using IE's Web Service Behavior To Create Rich ASP.NET Applications. I know the next version of ASP.NET uses something like client call back functionality that's able to only update small portions of a page without refreshing the whole page.

Of course using this technique still requires to call a method on a time interval.

Grz, Kris.
Chad,

thank you very much for your reply.
I have additional question. When you refer to a client-side script that can be used to refresh a browser, are you talking about a separate program running on the same machine where the browser is open, or it is something incorporated into the web form code that does it on a timely bases? If it was a separate program (which could know which instance of the browser I need to refresh, which form on that instance of the browser is open and how to envoke the refresh on the browser), it would probably work for me. I will just need to find out how to do it (if at all it is possible). Do you know anything about it? Any ideas/suggestions?

Thank you

ola
ola,

I was actually talking about using a JavaScript timer or using the Meta tags to refresh the browser. I think it would be nearly impossible to write a Windows app to know which browser to refresh when. This would be way more work than it's worth. I think your only solution here is to just put code in your page to refresh the entire page every so often. Sorry I don't have the perfect solution for your problem.

Chad

sub-selecting a DataTable?

Here's an example:
Dim dsMyData As DataSet
dsMyData = CallWebService(Param1,Param2)
Dim dtUsersTable As DataTable = dsMyData.Tables("Users")
I have a Web service that fills dsMyData with a couple tables.
My question is, from dsMyData.Tables("Users"), which contains all
users, how can I create another datatable that only returns for
UserID=1?
thanks...> Dim dsMyData As DataSet
> dsMyData = CallWebService(Param1,Param2)
> Dim dtUsersTable As DataTable = dsMyData.Tables("Users")
> I have a Web service that fills dsMyData with a couple tables.
> My question is, from dsMyData.Tables("Users"), which contains all
> users, how can I create another datatable that only returns for
> UserID=1?
This may not be the easiest way, but it should work:
'line below copies structure of Users table to NewUsers table
Dim newUserTable As DataTable = dsMyData.tables("Users").Clone
'line below renames the cloned table as to avoid naming conflicts
newUsersTable.tableName = "NewUsers"
'selects users with userid=1 and imports into NewUsers table
For Each dr As DataRow In dsMyData.tables("Users").Select("UserID=1")
newUsersTable.ImportRow(dr)
Next
' adds the newUsers table to the dataset
dsMyData.Tables.Add(newUsesTable)
Hope it helps.
Jeppe Jespersen
Jeppe,
That did help.
Thank you very much.
Eych
> That did help.
> Thank you very much.
No propblemo. :-)
Jeppe

sub-selecting a DataTable?

Here's an example:

Dim dsMyData As DataSet
dsMyData = CallWebService(Param1,Param2)
Dim dtUsersTable As DataTable = dsMyData.Tables("Users")

I have a Web service that fills dsMyData with a couple tables.
My question is, from dsMyData.Tables("Users"), which contains all
users, how can I create another datatable that only returns for
UserID=1?

thanks...> Dim dsMyData As DataSet
> dsMyData = CallWebService(Param1,Param2)
> Dim dtUsersTable As DataTable = dsMyData.Tables("Users")
> I have a Web service that fills dsMyData with a couple tables.
> My question is, from dsMyData.Tables("Users"), which contains all
> users, how can I create another datatable that only returns for
> UserID=1?

This may not be the easiest way, but it should work:

'line below copies structure of Users table to NewUsers table
Dim newUserTable As DataTable = dsMyData.tables("Users").Clone

'line below renames the cloned table as to avoid naming conflicts
newUsersTable.tableName = "NewUsers"

'selects users with userid=1 and imports into NewUsers table
For Each dr As DataRow In dsMyData.tables("Users").Select("UserID=1")
newUsersTable.ImportRow(dr)
Next

' adds the newUsers table to the dataset
dsMyData.Tables.Add(newUsesTable)

Hope it helps.
Jeppe Jespersen
Jeppe,

That did help.
Thank you very much.

Eych
> That did help.
> Thank you very much.

No propblemo. :-)

Jeppe

Thursday, March 22, 2012

Support for SQL views

In the database pane I see tables and stored procedures, but not views.
Are views (?) not supported?

Seems hard to imagine they're not ... but I don't see themWhere? In what tool? What is the database involved?
SQL Views are accessible from asp.net just like a table.

Tuesday, March 13, 2012

switch tables according to user input

i want to insert data in a particular table which i ask the user

how can i switch between database tables according to user input

Can you give more information about what you trying to do. What kind of input textbox, radio button, checkbox... Are they submitting something or are you wanting to do this on the fly?
You'd have to use dynamic SQL.