|
You look really young in that picture.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks! I attribute my youthful appearance to years of physical inactivity, lack of exercise and furious debugging. And ham.
/ravi
|
|
|
|
|
thanks a lot thats what i wanted to learn about.thanks
|
|
|
|
|
Hello,
I've manipulated the code from this site
http://www.geekpedia.com/tutorial50_Drawing-with-Csharp.html[^], as follows at the bottom of the page, and modifying the form in the way to show scroll bars. Doing it I got some problems with scrolling.
In fact, running the form everything go well, scrolling with the bar it repaint well... But if I click on the arrow for scrolling, it doesn't repaint as well. Try to check and let me know, please, how to solve this problem.
protected override void OnPaint(PaintEventArgs e)
{
// Get the graphics object
Graphics gfx = e.Graphics;
// Create a new pen that we shall use for drawing the line
Pen myPen = new Pen(Color.PaleGoldenrod);
Pen myBPen = new Pen(Color.Goldenrod);
// Loop and create a horizontal line 10 pixels below the last one
for (int i = 0; i <= 3000; i = i + 10)
{
gfx.DrawLine(myPen, 0, i, 2990, i);
}
// Loop and create a vertical line 10 pixels next to the last one
for (int x = 0; x < 3000; x = x + 10)
{
gfx.DrawLine(myPen, x, 0, x, 2990);
}
// Loop and create horizontal line 40 pixels next to the last one
for (int z = 0; z < 3000; z = z + 40)
{
gfx.DrawLine(myBPen, 0, z, 2950, z);
}
// Loop and create a vertical line 40 pixels next to the last one
for (int zz = 0; zz < 3000; zz = zz + 40)
{
gfx.DrawLine(myBPen, zz, 0, zz, 2950);
}
}
|
|
|
|
|
What does 'not so well' mean ?
This code doesn't show any signs of responding to scrolling at all, it just draws the same thing, as far as I can see.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I apologize, I missed to say I set A.minscroll property in the form to show the scroll bar...
|
|
|
|
|
Hi everybody,
I am dabbling with Crystal reports at the moment using C# .NET 2005.
Is it possible to specify the database source at runtime?
My program dynamically creates databases at runtime and stores their location in the registry. Being able to change databases at runtime would be of massive use.
Anybody got any ideas?
Thanks
Jonathan Harker
|
|
|
|
|
If the databases have identical schema information it is fairly easy, you can loop through the Database.Tables collection and set the logon information using SetLogonInfo. If the schema is even slightly different it is PITA and I don't have the code in front of me to help.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks for your quick response.
Unfortunately to complicate matters, the schemas in each table are quite different.
Jonathan Harker
|
|
|
|
|
Good luck! The documentation is sparse and can change between versions of Crystal, it can be done but the effort is not worth it. Instead set your reports to use a dataset data source and then use your application to bring the data together into an identical dataset and you will be able to use many different databases quite easily.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
been experimenting with the code, come up with this so far
<br />
OleDbConnection Connection = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;data source=C:\My db.mdb;");<br />
<br />
OleDbDataAdapter adapter = new OleDbDataAdapter();<br />
<br />
DataSet ds = new DataSet();<br />
<br />
adapter.SelectCommand = new OleDbCommand("SELECT CampaignName FROM ACTIVITY", Connection);<br />
<br />
adapter.Fill(ds, "ACTIVITY");<br />
<br />
ReportDocument rd = new ReportDocument();<br />
rd.SetDataSource(ds);<br />
<br />
crystalReportViewer1.ReportSource = rd;<br />
throwing the following exception:
Invalid report file path
not exactly sure what im doing here. please advise.
Jonathan Harker
|
|
|
|
|
When you initially create the report and specify the database through the CR wizard select a file based copy of your dataset. Then at runtime use the SetDataSource method then immediately afterwards call the Refresh report method.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I have two projects that are within the same solutions. Both windows application projects.
I reference the .exe file inside my main project and now I want the referenced project to use the main projects app.config file. How can I do this?
Inside the second project (the one being referenced) I put inside it's app.config: <appsettings file="mainApp.exe.config">
I then compiled and copied the second projects compiled config file to the main projects directory, so that I can include it in the clickonce manifest.
I run the clickonce to install but when app runs it doesnt seem like it is seeing the main apps config file.
Any help would be appreciated.
Steve Welborn
Software Engineer
Inrange Consulting
|
|
|
|
|
I can't compile this code in visual studio I get an error.
Could somebody help me.
class Recurse
{
public void foo(int f)
{
Console.WriteLine("Handed "+f);
if (f < 0)
return;
if ( f % 2 == 0)
this.foo(f - 5);
else
this.foo(f + 1);
}
}
class What_Does_This_Code_Print
{
public void RunExercise()
{
Recurse recurser = new Recurse();
recurser.foo(10);
}
}
|
|
|
|
|
1) Place your code around code and pre tags so it looks nicer.
2) What error did you get?
3) Does it specify a line number?
Windows Calculator told me I will die at 28.
|
|
|
|
|
4) When is your homework due?
|
|
|
|
|
Alex501,
When you make a post, make the subject of use not "i need help", we know that already. Also, post the error you get.
Regards,
Gareth.
|
|
|
|
|
Your code is fine. Perhaps you forget to include the System namespace?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Alex501 wrote: I need help with C#
Don't we all?!? That's why we're here
Dave
|
|
|
|
|
sounds like a homework question to me.
Steve Welborn
Software Engineer
Inrange Consulting
|
|
|
|
|
Probably not as his code compiles fine
Dave
|
|
|
|
|
you sure? Tried concatenating a string and an int recently?
|
|
|
|
|
J4amieC wrote: Tried concatenating a string and an int recently?
Yes, when testing his code - I wouldn't have done it, but when writing to the console it compiles and works. Try the code below!
static void Main()
{
int i = 5;
string s = "Test";
Console.WriteLine(s + i);
Console.ReadKey();
}
Dave
|
|
|
|
|
Hi Alex501
can you tell me here error message also.
thanks
|
|
|
|
|
I've got a small C# .NET application that manages users and logons for my company's website (for use by the customer service department). Now, I need to extend this program to be able to point to the production or test databases (for Q.A. testers). My problem is that it is built on a pretty hefty set of DLLs (that serve as the Data Access layer for this and several other related projects) that pull connection string from the .config file.
This is probably bad design, but I couldn't figure out how else to do it. Anyway, now I'm desperately searching for some way to deploy the project with two EXEs and two app.config files.
ClickOnce can allow me to deploy multiple executables, but that (as far as I can tell) requires a second VS project and so i would need to maintain the exact same code in two different spots instead of one (YUCK!). Unfortunately I don't know anything about MSI installers to know if they can help me.
Any pointers would be appreciated (about how to fix my design, certainly, but more so how to get past this last hurdle... as a rewrite of my DAL would take far more time than I have). Thanks in advance.
KBTibbs
|
|
|
|