Dataadapter rowupdating

If the select statement was of the form SELECT COUNT(*), [other stuff], would SQL Server be efficient enough to only do the count once?

I thought about running two queries on the database (one to count the number of records I should expect and one to return the records) but, really, there's got to be a better way. Value = 1 End Sub NOTE: You need to set Progress Bar1. I have an app that fills a dataset from a SQL database, and then writes the dataset to an xml file. I am basically just replicating data to the local user's machine, and several of the queries take a long time to run over VPN connection to the database (the way most of my users will use it), so I sank the whole operation into a Background Worker so that the user's app wont freeze up while it is running. NET Application Architect, Enthusiast, & Evangelist T. What I will do is use a "typical" number for max rows on the progress. I thought about running two queries on the database (one tocount the number of records I should expect and one to return therecords) but, really, there's got to be a better way.Finally, the statement is added to a // Namespaces, variables, and constants using System; using System. Ensure that strings, dates, and any other fields are properly delimited when values are substituted for parameter names in the , the solution remains fundamentally the same if you use your own custom updating logic. Sql Client; private const String CATEGORIES_TABLE = "Categories"; private const String CATEGORYID_FIELD = "Category ID"; private Data Table dt; private Sql Data Adapter da; private Sql Command Builder cb; private String Builder sb; // . Event Args e) private void update Button_Click(object sender, System.I have an app that fills a dataset from a SQL database, and then writes the dataset to an xml file. I am basically just replicating data to the local user's machine, and several of the queries take a long time to run over VPN connection to the database (the way most of my users will use it), so I sank the whole operation into a Background Worker so that the user's app wont freeze up while it is running. Value = 1 End Sub NOTE: You need to set Progress Bar1. I have an appthat fills a dataset from a SQL database, and then writes the datasetto an xml file. I am basically justreplicating data to the local user's machine, and several of thequeries take a long time to run over VPN connection to the database(the way most of my users will use it), so I sank the whole operationinto a Background Worker so that the user's app wont freeze up while itis running.I would love to use the backgroundworker progresschanged event to control a progress bar and show the user how much longer the background operation is going to take, but I can't seem to figure out how to make that happen... Max Value End Sub Private Sub Timer1_Tick(By Val sender As System. Maximum value to a sufficiently high value to ensure you don't exceed it when you set Progress Bar1. I would love to use the backgroundworker progresschanged event tocontrol a progress bar and show the user how much longer the backgroundoperation is going to take, but I can't seem to figure out how to makethat happen...