|
In my project we develop one application, which takes very long time for installation (many database interactions) & has many steps to follow.
Same for un-installation.
I want to automate this process, where the user will provide all the inputs at start & the installation will be done as per the instructions.
Example u have Visual studio 2012 setup. & u want to automate the installation, where u will provide all the inputs like languages, additional features & tools at the start of process. No need to wait in front of the machine.
I already have setup/installer.
I just want to automate the installation process ...
Whether is it 100% achievable by C# .NET?
If Yes then Please tell me how to start with? Plz share your experience if u have already done some thing like that before !!!
THANKS in Advance
~Rahul
|
|
|
|
|
Also the setup exe is a Java tool
|
|
|
|
|
Hi
Yes, you can automate the setup.
You can use tools like Autoit. But if you want to be more clever, use the inno setup to create you installer file. In the inno setup script you can define what to do during every stage of the installation.
Regards
Jegan
|
|
|
|
|
At my same company, we are using sql server 2008 r2 and C# 2010 and 2008 web, desktop and console applications that are accessing the same tables. Alot of time the tables are being accessed at the same time.
Thus my question is when do you recommend setting up connection pooling to the database. In other words, limiting the number of connections that can be setup to the database? I want to prevent too many deadlocks from occuring.
Thus can you tell me how the following:
1. when do you recommend connection pooling be setup?
2. Does it make a difference if this connection pooling is a web, desktop, console or some other C# application?
3. Can you point me to a reference and or some me some code how to setup the connection pooling?
|
|
|
|
|
classy_dog wrote:
1. when do you recommend connection pooling be setup? You don't have to do anything special to setup connection pooling. It is enabled and handled by framework automatically. But to make use of it fully, you need to dispose the SqlConnection objects immediately after using it. Obvious way to do this is to wrap connection objects in a using statement so that Dispose() gets called automatically. This is very important for the connection pool to perform well. Disposed objects goes back to the pool. When you do new SqlConnection() , it serves from the pool if available.
classy_dog wrote:
2. Does it make a difference if this connection pooling is a web, desktop, console or some other C# application? I don't think so. Connection pools lives in the "app domain". So for web applications, IIS manages this app domain and pools will be available throughout IIS lifecyle.
classy_dog wrote:
3. Can you point me to a reference and or some me some code how to setup the connection pooling? As I said earlier, you don't have to do anything. Just manage the connection objects properly.
Best wishes,
Navaneeth
|
|
|
|
|
My understanding is that the connection is returned to the pool when you close it; you don't need to dispose it immediately. I keep a connection for the life of am application (some of which are Services that run 24/7 for months on end) and open/close as needed.
I don't dispose (Usually with via using) until the application is ready to exit.
Instantiating the same connections millions of times a day is not a good idea.
IDbConnection.Close Method -- The Close method rolls back any pending transactions. It then releases the connection to the connection pool, or closes the connection if connection pooling is disabled.
http://msdn.microsoft.com/en-us/library/system.data.idbconnection.close.aspx[^]
|
|
|
|
|
PIEBALDconsult wrote: My understanding is that the connection is returned to the pool when you close it; you don't need to dispose it immediately.
From the documentation for SqlConnection.close()
"Close and Dispose are functionally equivalent."
PIEBALDconsult wrote: I keep a connection for the life of am application (some of which are Services that run 24/7 for months on end) and open/close as needed.
Not sure what that means. But
1. You should close it or dispose it when you are done with it in the functional block. There is no point in holding on to the instance.
2. The fact that a service is 24x7 doesn't mean that the database won't need to be rebooted. And if you are actually holding on to the connection then the result will be an exception. At least with the pool (connection close/disposed immediately) you have the chance of recovering eventually. The pool doesn't recover connections in use and it only drops connections when a usage attempt results in an error that is the result of a failed connection.
PIEBALDconsult wrote: Instantiating the same connections millions of times a day is not a good idea.
Object instantiation is a trivial cost in modern OO languages. So that can't be what you are referring to.
Connection creation in a modern data center is rather insignificant. However that doesn't matter because unless you explicitly set up the connection pool to do otherwise the pool will be holding active connections. So opening a connection does nothing but retrieve it from the pool. So "instantiating" means nothing in this context.
|
|
|
|
|
jschell wrote: "Close and Dispose are functionally equivalent
That's easy to disprove. Dispose also clears the ConnectionString so it needs to be set again if you want to reuse the instance (which you shouldn't from a purely ivory tower point of view).
jschell wrote: You should close it or dispose it when you are done with it in the functional
block
I close it.
jschell wrote: is rather insignificant
So? I'll still avoid it when I can.
modified 10-Feb-13 23:51pm.
|
|
|
|
|
classy_dog wrote: 1. when do you recommend connection pooling be setup?
Unless you have explicitly changed the connection configuration in your connection url then pooling always exists in C#/.Net.
classy_dog wrote: 2. Does it make a difference if this connection pooling is a web, desktop, console or some other C# application?
They behavior of the application makes a difference. For example generally it is pointless to have a pool in a standalone client application. And if one expects a lot of stand alone client applications then it could actually be a detriment. For low volume servers pools provide no benefit.
For high volume servers a pool might increase the overall tps (transactions per second). Whether that increase is significant is another matter. It depends on actual usage. However it will often have some positive impact.
There is a downside to pooling in that you must understand the limitations as well as understand how it behaves. For example if you have 100 active connections in the pool and the database is bounced, then you have 100 stale connections. Consequently those will result in 100 exceptions when you attempt to use them because the pool does not test them before giving them to you. And there is a very good reason for not testing them because doing so would basically incur the same cost as creating the connection in the first place as well as not providing any surety that when you use the connection that it still wouldn't be stale (because the database might be bounced after the test and before use.)
classy_dog wrote: 3. Can you point me to a reference and or some me some code how to setup the connection pooling?
As noted the connection pool is already set up.
If you wish to tune it for your application(s) then you can modify the url. That is documented in the following.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx[^]
Keep in mind that you can have different urls to the same database. Each connection string represents a different pool.
If you want to attempt to deal with the stale pool problem then look to the SqlConnection.SqlConnection.ClearAllPools() method.
|
|
|
|
|
When a user clicks a mailto link outlook may open, when a user clicks callto skype may open. How can I subscribe to these "events" in my own apllication.
what I want to do is open a custom app from a callto link on a webpage which will then in turn dial out using TAPI.
The problem I have is subscribing to this event.
|
|
|
|
|
was this a windows application or web app? please specify the library
Jibesh V P
|
|
|
|
|
Since you have posted in C# forum, I am assuming your application is stand-alone desktop application.
When a mailto link is clicked, browser is responsible to open the default mail client on the computer. I don't think you can handle this event. One way to achieve this would be by making your program as the default email client (if it is an email client). This is how it will work for callto also. AFAIK, mailto is part of the standard while callto is proprietary and defined by skype and skype extensions for browsers.
Best wishes,
Navaneeth
|
|
|
|
|
We have an article[^] on the subject.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks Eddy,
That looks like what I need. I will take a look at it and see.
|
|
|
|
|
|
|
hi,
i'm using visual c# 2008 xpress, sql srver 2005 xpress
the dataset is ItemDataDS
that's what i do :
SA.ItemDataDSTableAdapters.tblItemDataTableAdapter taItemData;
ItemDataDS ds = new ItemDataDS();
DataTable dt = ds.Tables[tablename];
i create and populate an array of objects ao and do : dt.LoadDataRow(ao,true);
when i check ds (debug) i find the table and in the table i find the data
finally i do : taItemData.Update(ds);
this is done without and error but when i check the db-table no data was written
the TableAdapters insert-, update-, select- and delete-methods work as i added and updated one record with the dataset-designer.
the fill() method also works 'cause this record can be seen in the ds.
any suggestions what i'm doing wrong or what i can do analyze the problem ?
thanks in advance
|
|
|
|
|
Don't post the same thing in the forums and QA - it duplicates work and wastes time, which is rude.
Pick one, and stuck with it.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
Hi,
You might need to set the insert, update and delete command for your dataadapter.
SqlCommandBuilder cmdbuilder;
cmdbuilder = new SqlCommandBuilder(dataAdapt);
dataAdapt.DeleteCommand = cmdbuilder.GetDeleteCommand(true);
dataAdapt.UpdateCommand = cmdbuilder.GetUpdateCommand(true);
dataAdapt.InsertCommand = cmdbuilder.GetInsertCommand(true);
Best Regards
Muthuraja
|
|
|
|
|
how to multiply combo box value with text box value in c# and also retrive in another text box that can be used for another addition of values
|
|
|
|
|
abhishek808000 wrote: combo box value Retrieve the value from the combo[^];
Double zeValueFromZeComboBox = Convert.ToDouble(comboBox1.SelectedValue);
Next, retrieve the value from the textbox;
Double zeValueFromZeTextBox = Convert.ToDouble(textBox1.Text);
Multiply and display result;
Double zeResult = zeValueFromZeComboBox * zeValueFromZeTextBox;
textBox2.Text = zeResult.ToString();
This is basic stuff, and you should be able to figure it out using the documentation. Are you doing a course on this stuff? Or learning it as a hobby?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Please use Parse or TryParse rather than Convert; think of the children.
|
|
|
|
|
it getting output is 0
my code is
Double a = Convert.ToDouble(cmbqua1.SelectedValue);
Double b = Convert.ToDouble(txtrt1.Text);
Double result1 = a * b;
txtpr1.Text = result1.ToString();
txtpr1.text shows 0 value
|
|
|
|
|
Use the ComboBox SelectedItem property instead of SelectedValue.
Double a = Convert.ToDouble(cmbqua1.SelectedItem);
Double b = Convert.ToDouble(txtrt1.Text);
Double result1 = a * b;
txtpr1.Text = result1.ToString();
Jibesh V P
|
|
|
|
|
thank you.. it works
|
|
|
|