|
hi all,
I am trying to change databse for a report.It has MS Access data connection by default.I am trying to chage to sybase through odbc.I follow the same steps recomeded by crystal report's web site..it seems not working...
any one can help on this...
thanks in advance..
code for you refer...alwys displaying connection error...
CrReportDoc.SetDatabaseLogon("dba","sql","posdataodbc","tmpdata");
CrConnInfo.ServerName="posdataodbc";
CrConnInfo.DatabaseName ="tmpdata";
CrConnInfo.UserID="dba";
CrConnInfo.Password="sql";
CrTables=CrReportDoc.Database.Tables; ;
for(int i=0;i<=CrTables.Count-1;i++)
{
CrTableLogoninfo = new TableLogOnInfo();
CrTable = CrTables[i];
CrTableLogoninfo = CrTable.LogOnInfo;
CrTableLogoninfo.ReportName =CrTable.LogOnInfo.ReportName;
CrTableLogoninfo.ConnectionInfo= CrConnInfo;
CrTable.ApplyLogOnInfo(CrTableLogoninfo);
CrTableLogoninfo = CrTable.LogOnInfo;
if(!CrTable.TestConnectivity())
{
System.Windows.Forms.MessageBox.Show("Error Connection");
return false;
}
CrTables[i].Location = "DBA." + CrTableLogoninfo.TableName;
}
break;
Jeyapandian Kb.
|
|
|
|
|
I'm working on a custom drawn ListView and when scrolled horizontally
it does not redraw itself. I couldn't find a scroll event in the FCL
reference and in the Windows Shell controls reference either. How could
I force redrawing when the control is scrolled horizontally?
|
|
|
|
|
I've been using C# for a long time. But one day, a friend ask me, what is the difference between them. I can't answer.
So, can anybody help me answer this little question?
|
|
|
|
|
Well, it is the one magical thing that grabbed me a few years ago
when I was reading a thin book about the C# language
The public field is just a variable that you can read and write
without any control. I mean that you can set the field any value
that is possible for the type of the field. And that's pretty much
it.
While the property is a more complex thing - it appears to be a
public variable but it's a totally different thing. A property is a
set of one or two functions in fact (accessor and/or modificator).
For example, assume that we have the "public string Name" property.
When the compiler generates the IL code, it generates also
one or both of the following functions:
public string get_Name() { the_statements_in_the_get_function; }
public void set_Name(string value) { the_statements_in_the_set_function; }
And you can do anything inside. Getting the value of a property
calls the get_Name function, and setting a value to the property
calls the set_Name function. That's pretty powerful, 'cause you can
do many more things than return/set the actual variable beneath (if
there is one) - you can raise events, force redraw etc.
And of course, we should thank Delphi for this nice language feature
Cheers!
|
|
|
|
|
Hello
If you'll look at COM, you will see, that defining a property for an object leads to appearing of two functions: get_PropertyName and put_PropertyName . In C++ you will use these functions to access the property value, in VB you can work with the property "directly" (obj.PropertyName ).
In C# is similar. There are two accessors set and get . And you can perform whatever calculation you want inside them.
Andrew
|
|
|
|
|
|
Actually, the two definitions that you got missed off something very important. You should never make a field public because it blows a great big hole the encapsulation aspect of OO.
Even if you just want direct access to a field in a class, you should wrap it in a property in order to future proof it against possible changes. At the moment you may only need to set the field underneath the property. But in future you may need to tell other objects about the change. If you were just accessing the field directly then you couldn't add this functionality easily.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Yes, yes! That's very important! Never expose a field publically
unless it is a readonly or const. But you even can do it for them too.
The only case that I use public fields in, is when deriving from EventArgs.
I put some data as public readonly fields to reduce the code and to
speed up the handling a little bit.
And if you look up the FCL reference, there's almost no public fields exposed,
unless constants such as EventArgs.Empty, String.Empty and so on.
|
|
|
|
|
A property is like creating a whole method for manipulating a field.
/\ |_ E X E GG
|
|
|
|
|
i need to merge two PNG images (loaded in memory) into one without lose the transparence of both (if there are some transparent area inside the first one or the second one or of both that are not mask by the other let it ).
How can i do it?
Then i need to get the final PNG file in memory and put it on a picturebox.
It is really important, please help me if you.
Thanks.
|
|
|
|
|
Compare each pixel and make an OR operation.
The PROgrammer Niklas Ulvinge aka IDK
|
|
|
|
|
Well, here's what you can do:
1) create a new Image object (with the appropriate size)
2) get a Graphics object for it (Graphics.FromImage static method)
3) draw the first image on the new image (using the Graphics object)
4) draw the secons image on the new image
5) now you have an Image object that meets the requirements
Or, if you don't need one of the images, draw the other one
over it.
Cheers
|
|
|
|
|
<br />
3) draw the first image on the new image (using the Graphics object)<br />
4) draw the secons image on the new image<br />
5) now you have an Image object that meets the requirements<br />
3) what method do i need to use?
4) what other now so to don't overwrite the whole first image?
|
|
|
|
|
3) use the DrawImage method of the Graphics class
4) you don't need to do anything else special. If the
image that you'll draw over the first one is transperant,
GDI+ will draw it correctly with alpha blending. Don't worry,
just try it. I have and it works just fine
|
|
|
|
|
ok really thanks now the last thing:
To create the right Image object to hanlde png 32 bit image how declaration syntax i have to use.
Stop, tnx!
|
|
|
|
|
hi I m new in c#. want to run unsafe block in managed code. can anybody tell me how to chane option to run code in unsafe execution mode?
|
|
|
|
|
Hello
You need to set Allow Unsafe Code Blocks in Configuration Properties of your project.
And of course use
unsafe
{
}
Andrew
|
|
|
|
|
hi
i have written a program before .but when i run that now this error was appeared:
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation.
please help
thanks
|
|
|
|
|
Without seeing your code and the line on which it breaks, it's impossible to tell you whats wrong. What is your code doing when it breaks?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello to everybody!
I've been programming in c# for a couple of months and got a problem in an application i'm creating for a little company.
my application lets you control a little transponder reader, linked to the pc by a serial cable. this application should also let you update the firmware, using an external executable thet was created by another software house.
this external program shows a little form with an "update!" button. users should click on this button to start firmware updating.
the problem is, my boss doesn't want this little form to appear and wants instead the firmware to be updated without users have to click on this external form.
i found the code of an old c++ program they used to do this. it used the function setTimer to give the little form a value corresponding to "enter" key, immediately starting the firmware update.
is there any way to do this in c#?
please understand i am relatively new to the world of programming. i studied a little java at the university and a little c# by myself.
i'd really appreciate any help on this, because i can't really cope with this.
oh and by the way sorry for my bad english.
thanks in advance, Rey9999
|
|
|
|
|
Hi,
1. Checkout if the external program allows to you to have command line options for updates. like /u etc, to find out use <appln.exe> /? or /help
2. Otherwise, use process ProcessInfo to call the application and use Process.Showwindow = false (dont remember the exact function name) and use Sendkeys "{SPACE}" if you still wish to do the old C++ way.
3. The otherway would be to use Win32API to execute commands and get hold of the window.
|
|
|
|
|
thanks for your fast reply!
i tried solution no. 1 but this application takes no parameters.
so i tried solution no. 2 but i noticed the "keystroke" is sent to my form, not to the external application; i think it's because my form is seen as the active application, not the external executable.
i'd like to try solution no. 3 but i don't really know how to do it.
i know i may sound annoying but can you give me a hint on using this Win32API stuff?
i wish i knew more about programming but you know italian universities...
thanks alot, Rey9999
|
|
|
|
|
Hi,
maybe somebody use CSTA in C#? where i can find some sample? etc.
Greetings
|
|
|
|
|
What do you mean with CSTA?
Canadian Sport Tourism Alliance?
California Science Teachers Association?
(These were among the first results from Google for CSTA)
Or Computer Supported Telecommunications Application?
Or something else?
With just a TLA or FLA it's hard to find what you want.
mav
(TLA: Three Letter Acronym, FLA: Four Letter Acronym)
|
|
|
|
|
Heh....
just Computer Supported Telecommunications Application
Greetings
|
|
|
|