|
If no changed are made just call xlsWorkbook.Save and then close it to remove the prompt. Set visible to false if you are using it as an engine and set xlsWorkbook.IgnoreRemoteCall (I think thats it, intellisense will tell you for sure) so it opens as a single-instance.
|
|
|
|
|
Thank you, EliottA. This may be a good solution in case we are not able open the file in Read-Only mode.
lk
|
|
|
|
|
Np, good luck and let me know how it turns out.
|
|
|
|
|
it seems has no save() mothod in class Workbooks.
Thanks.
lk
|
|
|
|
|
It has a Excel.SaveWorkspace[^] method which you should investigate. You can't save a single worksheet but your entire workbook you can.
|
|
|
|
|
Yes, you are right.
but if I call it to save the file, another dialog box "...file already exists in this location. Do you want to replace it?" appears.
lk
|
|
|
|
|
I don't know what to tell you, save it as a random filename, delete the old one and rename the saved one to the old filename. Come on man do a little thinking for yourself here.
|
|
|
|
|
EliottA, Thank you for your help. I have got the solution.
Set the Saved property for a workbook to True without saving the workbook to the disk, Microsoft Excel will quit without asking you to save the workbook.
lk
|
|
|
|
|
How can i create an customize label with surrounded rectangle.
|
|
|
|
|
You can inherit a control from System.Windows.Forms.Label and override its OnPaint event:
public BorderLabel() {
InitializeComponent();
this.Paint += new System.Windows.Forms.PaintEventHandler(BorderLabel_Paint);
}
void BorderLabel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
Brush brush = new SolidBrush(Color.Red);
Pen pen = new Pen(brush);
Rectangle rect = e.ClipRectangle;
rect.Inflate(-1, -1);
e.Graphics.DrawRectangle(pen, rect);
}
Regards,
Lev
modified on Thursday, January 8, 2009 6:15 AM
|
|
|
|
|
Lev Danielyan wrote: OnPain event
I know that one well!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I wish I did it on purpose
Regards,
Lev
|
|
|
|
|
hello friends ..this the piece of code from my C# program
pls help me how to increase the the input from 2(present input intake) to 9 inputs
public void Process(int[] problem)
{
double[,] T = new double[states.Length, 3]; //We will store the probability sequence for the Viterbi Path
vPath = new int[problem.Length];
vProbs = new double[problem.Length];
//initialize T
//------------------------------------------------------------------
for (int state = 0; state < states.Length; state++)
{
T[state, 0] = startProbability[state];
T[state, 1] = state;
T[state, 2] = startProbability[state];
}
for (int output = 0; output < problem.Length; output++)
{
double[,] U = new double[states.Length, 3]; //We will use this array to calculate the future probabilities
Console.WriteLine("\nTesting hypothesis {0} ({1})", output, observations[problem[output]]);
double highest = 0;
for (int nextState = 0; nextState < states.Length; nextState++)
{
double total = 0;
double argMax = 0;
double valMax = 0;
Console.WriteLine(" Estimating probability for future state {0} ({1})", nextState, states[nextState]);
for (int state = 0; state < states.Length; state++)
{
Console.WriteLine(" The testing state is {0} ({1})", states[state], state);
double prob = T[state, 0];
double v_path = T[state, 1];
double v_prob = T[state, 2];
double p = emissionProbability[state, problem[output]] * transitionProbability[state, nextState] * scaleFactor;
|
|
|
|
|
lawrenceinba wrote: increase the the input from 2(present input intake) to 9 inputs
The current input is a int array. What do you mean "from 2 to 9"? More detail please.
I Love KongFu~
|
|
|
|
|
that array accepts only 2 inputs at present.... now i should increase it ro 9 input,, how to do tat friend
|
|
|
|
|
int[] inputs = new int[9];
Then assign the value for inputs array. Is that what you want?
I Love KongFu~
|
|
|
|
|
Dear All:
I create a usercontrol , there is a button in it, I place this control on one winform,I want to remove the control from the winform by clickinng the button on the control in design environment,
how to write the code under the button_Click?
Thanks in advance!
Tramp
|
|
|
|
|
i think u can use Form.Controls.Remove(index) ;
rahul
|
|
|
|
|
Well first you don't put the code for this in the control (bad habit).
You expose a event on your control, the button click raises this event.
Then on the form that contains the control you catch this event and there you write the code to remove the control.
From memory (so you might want/need to adjust it a bit)
'in the event off the control
'customcontrol = the name of your control as it is named on the form
controls.remove(custumcontrol);
You can also pass along the name of the control in the event, then you can replace 'customcontrol' with that.
Hope this helps
[EDIT]Adjust the code to c# (forgot I wasn't in the vb.net forum [/EDIT]
|
|
|
|
|
mctramp168 wrote: in design environment
You really want to do this in design enviroment rather than pressing the ‘Delete’ buttono?
I Love KongFu~
|
|
|
|
|
thanks, I only want to know how to realize this function.
|
|
|
|
|
my application has the following procedure.
a database of products (20,000 rows) exists.
our client has 'import' feature where he imports an excel file.
this is implemented by deleting all products table rows, then doing the import - which is a long thing since we programmatically performing calculations on the data.
the obvious problem is if the 'import' action fails (IO stuff), they now have none/partial/curropt data in the products table.
We wish that if the 'import' operation fails, the original data remains.
this is ASP.NET application, written in C#, using SQL Server 2005 and using XSD which we created through the VS2005 design tools.
|
|
|
|
|
You can use transactions and roll back in case of errors.
Try googling[^] around
Regards,
Lev
|
|
|
|
|
1) Make a copy of the table that the stuff gets imported to. Ensure that this table is empty.
2) Import all your stuff to the secondary table
3) If there are no exceptions then delete everything in the original import-table, and copy all stuff from the secondary table to the import-table. If an exception did occur, the original import-table will still hold all data.
You could also use transactions to achieve a similar functionality. SQL Server caches all changes that way, in order to 'undo' them.
I don't know which of these options would serve you best. The transaction-approach would probably be faster to implement.
I are troll
|
|
|
|
|
Hi all
In windows forms we use "Application.StartupPath" to get the application folder does anyone know the equavalent for webpages,
I need to write a file using a filestream but i need the root folder for the web application on the server.
Regards
|
|
|
|