|
Code Start
//Crystal Report Object
CrystalReport2 cp = new CrystalReport2();
CReport cp1 = new CReport();
//Form Load Event
private void Form2_Load(object sender, System.EventArgs e)
{
crystalReportViewer1.ReportSource = cp;
}
//Link Label Click Event
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
try
{
string empid = textBox1.Text.Trim();// H-B39728F employee id
SqlConnection con = new SqlConnection("server=SK-WAQAS;uid=sa;pwd=Butt;database=pubs");
SqlDataAdapter daemp = new SqlDataAdapter("Select * From employee where emp_id= '" + empid + "'", con);
DataSet ds = new DataSet();
daemp.Fill(ds,"employee");
cp.SetDataSource(ds);
con.Close();
}
catch(Exception ce)
{
MessageBox.Show(ce.Message);
}
}
// End Code
When i run this code no record show in Crystal Report. Please tell me where is do mistake. I want to show record in crystal report on the base of emp_id , i use pubs database on Sql server 2000.
Thanks in advance.
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
i'm having this type of error 'Underfined label 'main' in function main' in my program. please can anyone be of help here. thank you! do mail me for more information.
Arshad
|
|
|
|
|
What do you not understand? The compiler message is very clear: 'Underfined label 'main' in function main'
You're using a label called "main" in your function "main" and this label is not defined.
Most likely you've got a syntax error, but without even giving the full and correct error (the compiler didn't output "Underfined" for sure!) or the code line the error occurrs on you won't get any decisive help!
mav
|
|
|
|
|
|
hi dears ,
I have a problem
I create a class with delegate and event !
when i used it in another class with remoting , i recevied this Error :
"Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level."
what is probelm?
|
|
|
|
|
Hello,
I am wondering if anyone can point me in the direction of a nice bit of code to draw a tree structure. Not the tree that is one of the default windows controls, but the list tree structure
O
/ \
O O
/ | \ \
O O O O
like that.
Thanks
The wisest of the wise may err. - Aeschylus
|
|
|
|
|
How does one go about making part of the messagebox() show a web link?
something to the effect of:
MesageBox.Show("Help File Not Found: \n\nTo download the latest Helpfile, go here:" + SomeSortaWeblink(http://www.mysite.com))
Any help is truly Appreciated
-- modified at 0:30 Sunday 2nd October, 2005
|
|
|
|
|
You can't. You'd have to create your own dialog box that has a Link control in it.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
There is no direct solution to this.
What you can do is , write a Customized Message Box (your own Form) which can include this.
Regards
Mahesh
Regards
Mahesh
|
|
|
|
|
i need to serialize an object but before to serialize i want to encrypt it
How can i encrypt? Can someone decrypt it with some program?
|
|
|
|
|
Hi,
don't serilize it directly to a file. First serialize it into a MemoryStream. Then put that one into a CryptoStrem (this article should give you the basic idea on how to use it). The output of that one can then finally be written to a file (FileStream class).
If you use the cryptographic classes correctly it will be very hard to nearly impossible for someone else to decrypt it.
|
|
|
|
|
Hi, tnx for your advise, but just one consideration:
if i use these lines in my code
cryptic.Key = ASCIIEncoding.ASCII.GetBytes(“ABCDEFGH”);
cryptic.IV = ASCIIEncoding.ASCII.GetBytes(“ABCDEFGH”);
it can be get in back by hackers opening my application in assembly code or just if it crash for whatever cause.
Isn't it?
My trouble is can someone got these keys? so use to decrypt manually the stream?
|
|
|
|
|
This is the problem facing everyone, and there is no way around it. There are numerous ways to make it harder for someone to get the keys, but ultimatley if you want to encode and decode from within your program then you will be susceptible to the problems you mentioned.
However, if the user is entering the key/password then it's a different matter entirely, and you can make it very secure.
|
|
|
|
|
I'M TRYING TO BUILD A WEBSITE WITH A DOWNLOAD PAGE.
BUT THE PROBLEM IS; I NEED TO CREATE A CODE FOR THE LINK, ONCE THE CUSTOMER PURCHASES THE PRODUCT AND PAYMENT IS COMFIRMED THEY THEN GO TO THE DOWNLOAD PAGE.
BUT, I DON'T UNDERSTAND HOW TO BUILD THAT CODED DOWNLOAD PAGE LINK, I'M WAY OVER MY HEAD ON THIS ONE.
CAN ANYONE HELP ME BUILD THAT CODED DOWNLOAD LINK? I'M SO CONFUSED.
I DON'T UNDERSTAND THIS CODE WRITTING STUFF,
THIS IS MY FIRST TIME AND I NEED A LOT OF HELP.
PLEASE CAN ANYONE HELP ME? PLEASE.
IT'S SO HARD I DON'T UNDERSTAND...
????
|
|
|
|
|
STOP SHOUTING
dontunderstand wrote:
I DON'T UNDERSTAND THIS CODE WRITTING STUFF,
THIS IS MY FIRST TIME AND I NEED A LOT OF HELP.
I'm sorry so many people voted without giving you advice. My advice, you shouldn't do anything that will be seen in the real world for your first project. You should take the time to learn some stuff first.
A really simple way to do this is with a response.redirect statement in your page when payment is confirmed, which goes to either the zip ( which will start a download ), or the page with the zip ( which you can hide from google, but which someone will hand out, or discover, eventually. You should password protect your zip and send the password as another line of defence and a way to get your clients email addresses ( don't sell them or spam them, but do use them to send info on updates, etc. )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Suppose I have this:
public Pen[] activePen = new Pen[] { new Pen( Color.Blue ), new Pen( Color.Green ), new Pen(Color.Red) };
How to infinitely cycle through the 3 Pens?
thanx
|
|
|
|
|
Like this?
int i = 0;
while (true) {
i = i % 3;
Pen nextPen = activePen[i];
i++;
}
|
|
|
|
|
That works-thanks-- but I have one Pen array for the form and
several different g.DrawLine calls to put a few different colored
lines on the form due tied to text boxes --- thanks again
|
|
|
|
|
Well you don't need the while loop. Instead make a private member out of i and put call this method to get a Pen:
private int _penIndex = -1;
private Pen GetNextPen() {
_penIndex = (_penIndex + 1) % 3;
return activePen[_penIndex];
}
|
|
|
|
|
HI, I WAS WONDERING IF YOU KNOW HOW TO WRITE A CODE TO A DOWNLOAD PAGE?
IF SO CAN YOU PLEASE HELP ME?
I JUST DON'T UNDERSTAND HOW TO DO IT...
dontunderstand
|
|
|
|
|
I have code that will draw a line on a form. When I hard code it to draw the line it works fine, meaning every time
the form launches a line is drawn. Now i want to set a bool flag and pass it in as a conditional statement to drawn the
line when the Button1 is clicked. I know I'm missing something obvious.
public class Form1 : System.Windows.Forms.Form
{
//Member fields.
private bool drawLine1 = false;..............etc
///////////////////////////////////////////////////////////////////////////
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
if(drawLine1) //DRAW LINE 1 IS ALWAYS FALSE.....
DrawComplexNumber(e.Graphics);.............etc
//////////////////////////////////////////////////////////////////////////
private void Button_1OK_Click(object sender, System.EventArgs e)
{
drawLine1 = !drawLine1;
Invalidate();
}
How do I fix it? Please -- need a "nuts and bolts" answer, not an "abstract" explanation. Thanks a lot in advance....
|
|
|
|
|
The code seems to be ok but I noticed that your button click eventhandler has a strange name. You should probably check if the click event of the button is really bound to that method.
Just check (eg by setting a brakepoint) if the drawLine1 = !drawLine1 is being hit and if drawLine1 has the correct contents afterwards.
Then check if you prpbably set drawLine1 back to false somewhere else in your code. Doing some Console.WriteLine("DrawLine1: " + drawLine1.ToString()) here and there should also help you to trace down the problem.
Hope you don't feel this answer is abstract but if you test this code in an empty form you will see that it works and that the error must come from somewhere else.
|
|
|
|
|
You were absoutely right. Thought I was going nuts-- thanks
works fine now
|
|
|
|
|
Try out this code as an example -
public class Form1 : System.Windows.Forms.Form<br />
{<br />
private System.Windows.Forms.Button button1;<br />
private bool drawline = false;<br />
private int radius = 25;<br />
private int green = 10;<br />
private int red = 10;<br />
private int blue = 10;<br />
}<br />
<br />
<br />
private void Button_1OK__Click(object sender, System.EventArgs e)<br />
{<br />
drawline = !drawline;<br />
Random r = new Random(100);<br />
Int32 x = Int32.Parse(r.Next().ToString().Substring(1,2));<br />
Int32 y = Int32.Parse(r.Next().ToString().Substring(1,3));<br />
<br />
if (green < 230)<br />
green += 10;<br />
<br />
if (blue < 230)<br />
blue += 10;<br />
<br />
if (red < 230)<br />
red += 10;<br />
<br />
if (drawline)<br />
{<br />
System.Drawing.Graphics g = this.CreateGraphics();<br />
Point P = new Point(x,100);<br />
Point p1 = new Point (100,y);<br />
Color j = Color.FromArgb(red,green,blue);<br />
Pen Pe = new Pen(j);<br />
<br />
g.DrawEllipse(Pe,x,x ,radius, radius);<br />
radius += 20;<br />
}<br />
else<br />
{<br />
System.Drawing.Graphics g = this.CreateGraphics();<br />
Point P = new Point(x,100);<br />
Point p1 = new Point (100,y);<br />
Color j = Color.FromArgb(red,green,blue);<br />
Pen Pe = new Pen(j);<br />
<br />
g.DrawEllipse(Pe,y,y ,radius, radius);<br />
radius += 20;<br />
this.Refresh();<br />
}<br />
}
Regards
Mahesh
|
|
|
|
|
Is there a property build for a DataGrid in a C# Windows Application?
I have used this feature when building web applications, but it does not appear to be present as I am building a Windows application and want to do a basic layout for my datagrid without manually constructing the data columns and features.
Thanks.
SD
|
|
|
|