|
Hello,
I try to set the installer to always overwrite files during the installation, the Transitive property is set to true on them, but sometimes it doesn't work. Any idea how to make sure the files are overwritten?
Second question,
When i runas /user:admin cmd on non admin account and run the msi package from there, it doesn't fully install. When I run the application after that, it install some additional things, if this is done from non admin account, error message pops up it cannot find the installation package (it was installed from usb stick, if the package is copied to the hdd, error message doesn't show).
Is there any way to avoid such behavior?
Thanks!
|
|
|
|
|
For the first question: Windows Installer has a set of rule to decide if overwrite an existing file. These rules take into account create/modified dates and file version, if there is any.
More details here[^].
|
|
|
|
|
Hi,
Pls tell me How to set user-defined-type as Oracle SP input parameter in .NET 2005 with oracle database 10g client.
example :
I created simple object type
create or replace type TYP_address as object
(
-- Attributes
address VARCHAR2(500),
ZIPCODE Varchar2(5)
)
create table TAB_ADDRESS
(
ADDRESS VARCHAR2(200),
ZIPCODE VARCHAR2(5)
);
create or replace procedure test_udt_sp(obj_address IN TYP_address ) is
begin
INSERT INTO tab_address(address,ZIPCODE) VALUES(obj_address.address,obj_address.ZIPCODE);
COMMIT;
end test_udt_sp;
Now How i call this procedure "test_udt_sp" with what type of input parameter of obj_address.
Pls help me in this.
Thanks in Advance.
Anil
|
|
|
|
|
This thread[^] has the same example you are mentioning, with the answer.
|
|
|
|
|
Hi,
i givng my code below.
I created two types for input and output parameter for a functions.
type get1 as object(deptno number(5))NOT FINAL;
TYPE GET2 AS OBJECT(DNAME VARCHAR2(14),LOC VARCHAR2(13))NOT FINAL;
///Function code :
function getdata(id in get1,data out get2)
return varchar2 is retval varchar(10); begin
select get2(dname,loc) into data from dept where deptno = get1.deptno;
retval := 'Result'; return retval; end;
///My .net code :
OracleConnection con = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.2.3)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORACLE)));User Id=scott;Password=tiger");
OracleCommand cmd = new OracleCommand("getdata", con);
cmd.CommandType = CommandType.StoredProcedure;
GET1 objget1 = new GET1();
GET2 objget2 = new GET2();
objget1.DEPTNO = 10;
GET2[] get22 = null;
OracleParameter outparam = new OracleParameter();
outparam.OracleDbType = OracleDbType.Object;
outparam.Direction = ParameterDirection.Output;
outparam.ParameterName = "data";
outparam.UdtTypeName = "GET2";
outparam.Value = objget2;
OracleParameter inparam = new OracleParameter();
inparam.OracleDbType = OracleDbType.Object;
inparam.Direction = ParameterDirection.Input;
inparam.ParameterName = "id";
inparam.UdtTypeName = "GET1";
inparam.Value = 10;
con.Open();
cmd.ExecuteNonQuery();
when i'm executing the below error is coming.
"ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of arguments in call to 'GET_DATA_NEW'\nORA-06550: line 1, column 7:\nPL/SQL: Statement ignored"
Pls help me.
modified on Tuesday, February 24, 2009 1:59 AM
|
|
|
|
|
How to override Button Click EventArgs or use another ways to achieve it?
in the button_Click,there is only two parameters(object sender and EventArgs e), now I want to override the Button_Click add
a bool parameter, if the parameter is true then execute this click event, otherwise doesn't execute this click.
It can not be overrided the button1_Click by adding a parameter directly, It seems to be feasible by override the EventArgs,
But I am a novice, and don't know how to achieve this function, if give me detail code,I'll very appreciate your assitance.
Thanks in advance!
|
|
|
|
|
You must be setting the bool parameter somewhere, right? Won't this be solving your purpose?
private void button1_Click(object sender, EventArgs e) {
if (SomeBoolean) {
}
}
Here SomeBoolean is a class level variable.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
It maybe can not be solved by this means. my purpose as below:
I want to override the button Click event,after override the click event it contains below code default,when I use the button_click,I have to pass a boolean value for it.
if (BlnFlag)
{
MessageBox.Show("");
}
else
{
return ; //do nothing
}
the BlnFlag is passed from WinForm which used this kind Button,it is not pass from the Button Class.
Could you give some suggestion?
|
|
|
|
|
Instead of asking about how you think that it should be solved I think that you should ask about what it is that you are trying to accomplish.
The event handler is normally called by an event. As you are trying to call it directly suggests that you are using the wrong tools for your solution.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
mctramp168 wrote: the BlnFlag is passed from WinForm which used this kind Button,it is not pass from the Button Class
Cant get this. The button must be on a winform. On the same winform, you will be setting the flag which will decide if the code should be executed or not.
I dont see any need to create your own button. You can use the code I had posted. If the boolean is set on some other form, and the button is on a different form, then there are a lot of ways to pass it on.
If you can post what exactly are you trying to do then maybe someone can help better.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
thanks, I know the method you suggested, because many winform will use this kind of button, if I create my own button, then I can write my code code in this event, no need write the code under the others winform click event.so I have to pass a parameter from the current winform to this event decide to how to run it. can you give some comments on it?
|
|
|
|
|
Hi,
if you want to make a button do nothing, then disable it by setting its Enabled property false; that will alter its appearance so the user knows, and it will prevent some events from firing.
if you want a button to do alternate things, then I suggest you change its Text property so the user knows what to expect; your clicked handler can check the Text to see what needs to be done (beware internationization though).
if you don't want the appearance changed (I strongly object to invisible GUI changes mind you) you can use a flag somewhere and test it in the handler; one easy place to store such a flag would be in the Tag property: each Control has a Tag property (type is Object) that is available for any purpose you choose. I have never done that for disabling buttons, and I never will!
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:16 AM
|
|
|
|
|
You can do something like this and use the MyButton in place of the in built one wherever you need this functionality:
public class MyButton : Button
{
public new event EventHandler<ButtonClickEventArgs> Click;
public new void PerformClick()
{
PerformClick(false);
}
public void PerformClick(bool value)
{
OnClick(new ButtonClickEventArgs(value));
}
protected override void OnClick(EventArgs e)
{
OnClick(new ButtonClickEventArgs(false));
}
protected virtual void OnClick(ButtonClickEventArgs e)
{
EventHandler<ButtonClickEventArgs> eh = Click;
if (eh != null)
eh(this, e);
}
}
public class ButtonClickEventArgs : EventArgs
{
private bool m_Value;
public ButtonClickEventArgs(bool value)
{
m_Value = value;
}
public bool Value
{
get { return m_Value; }
}
}
Edited to get generic < > to display!
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)
modified on Wednesday, February 18, 2009 7:18 AM
|
|
|
|
|
Thank Dave , Do as you say ,the issues is solved.
|
|
|
|
|
How to create a .exe file for the project developed in dotnet with c#
|
|
|
|
|
When you compile the project, EXE will be produced automatically in bin directory.
|
|
|
|
|
To do it in a Good way, Add a Setup Project to your Application.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
I use a connection via a client machine, to SQL server which is on server. These two machines are in a workgroup. whenever I restart the client machine, I have to first, connect to my server through windows address bar, and then the connection via my code (C# 2005) can be established. If I restart my program any time after this, it can connect to SQL Server. But when I restart the client machine, this happens again. I use the appropriate network library. Would you please let me know why this happens and what should I do? (the logon to the client machine is done locally)
|
|
|
|
|
I use a Microsoft IIS in order to getting a service via client-server connection. but after some time passes, the service becomes down and I have to start it again. Would u please help me why and what should I do.
Thanks in advance!
|
|
|
|
|
Can you please be more Clear.
Are you talking about Windows Service ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Dear All,
i have the datatable returns from sql store procedure:
sproResults = myUtils.ExecSproc(objSession, "spVoucherDetails_SelPending", printRunNumber);
and i loop through this table and try to write each row into a .csv file and save into disk, i know my current implementation wasn't quite right in here. Can someone plz advise me?
FileStream fStream = new FileStream(@"C:\Voucher\CompleteVoucher.csv", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
foreach (DataRow row in sproResults.Tables[0].Rows)
{
fStream.Write();
}
Thanks heaps.
|
|
|
|
|
AndieDu wrote: i know my current implementation wasn't quite right in here
Wrap the FileStream in using block. So it will get disposed when the scope ends. Something like
using(FileStream fStream = new FileStream(@"C:\Voucher\CompleteVoucher.csv", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None))
{
} If you are appending the text, easy way is to use File.AppendAllText[^]
|
|
|
|
|
do you by any chance get a blank file?
also i think you prob want to use WriteLine() method for each row
plus you need to write the values, something like this
foreach(DataRow row in sproResults.Tables[0].Rows)
{
object[] vals = row.ItemArray;
for(int i = 0; i < vals.Length - 1; i++)
{
fStream.Write((string)vals[i] + ",");
}
fStream.WriteLine((string)vals[vals.length - 1]);
}
then dont forget to close the stream i.e. fStream.Close();
EDIT: The above code would need ammending to handle null values, also FileStream will not support WriteLine. Thou i didnt actually specify the instance
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Yummy, code that doesn't work.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
well it certainly was not tested, but what would not work?
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|