a lot of client will send data to this port in order to handle it i have used mutithreading.
After receiving data from port i have to save it in database now i m using
classical way to save in database
like open connection save data and then close connection and dispose connection.
as we know every time opening and closing connection take time .
Because within a second 30 or more than 30 client is sending data to this port to this port every time opening closing connection is not idea.
so please suggest how to use one connection for all request first time only it open connection and from next time my app use the open connection.
I don't understand your question if there is any question.
Shivendra Pandey wrote:
It means only first time the database will open from next time it use the same open connection for every request.
As long Connection is opened it will be used for request. However you need to handle connection timeout (Disconnected by unkown reasons).
Shivendra Pandey wrote:
one dedicated open connection for all request in this service
If you use app or service as "front end" (app that sits on server and it is betwen client and database) and connect to database service than that can be acheaved. That app needs to handle a multiple connection if you want to use multiple clients at the same time
Probably you don't want that.
For example, if the connection is lost, what happens?
If two clients try to use the connection at the same time? One client starting a transaction will in fact be starting a transaction over the connection used by everyone (for example, in Sql Server if there is a transaction, you must use it).
And, finally, there is the connection pooling. By default, when you open and close a connection, the real connection keeps opened, but it is returned to the pool. Opening it again will only use the already opened connection. So, the best practice is to open the connection for each web-method and close it at the end. You can, of course, configure the maximum pool size to 1, so only one real connection will be kept open.
I am working in windows DatagridView,i assigning value through the Datasource, but in the grid also having the combo box where values are populated from the dataset. At the runtime, if i am click the grid, it throws the error like ='Datagridviewcomboboxcell value is not valid' .
if you are running program on pc1 and installed database on PC2 then you shoud use connection string as below.
SqlConnection thisConnection = new SqlConnection(
"Server=pc2 IP or pc2 Name;Integrated Security=True;
1- Server side:
Run Sql Server browser Service in your database server machine, then
create Valid login for your database,set sql server authentication to Windows and SQL athentication
2- Application side:
with a form like this: http://privateimage.com/images/9fq89vuk7uokjz8koz.jpg
I'm attempting to create several ComboBox controls on a windows form that are all connected to a relational database. The controls "narrow" their selection choices when any other given ComboBox is selected to an item.
Similar to say..narrowing down a motherboard model by selecting Intel/AMD --> Socket --> Chipset --> etc. As I'm quite new to working with data in C#, I was hoping someone could offer a good reference that I can use to read up on this - preferably, a beginner's reference.
I am writing a c# program that uses property grids. The problem is that for some reason they are displayed in the basic graphics version, the scroll bars are the standard old grey version. The version that you got in windows 95 (i think), or if you turn on the classic theme in windows.
I beleve that the issue is with my current project because when i make a new project, and put a property grid on the form, its scroll bar are displayed correctly, in the current windows theme.
does anyone know how to fix this for my current project?
Last Visit: 31-Dec-99 19:00 Last Update: 30-Nov-23 12:05