|
That's a lot of code to wade through! Without your database, no one can run it - not that they would, probably. Don't try to post your database here - just answer the questions:
1) What is happening when you run the program?
2) What did you expect to happen?You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
I WANT TO DATA SHOW IN DATAGRID BUT IN DATASOURCE EOOR
error is in line:
dataGridViewX2.DataBindings.Add(new Binding("DataSource", dsDataBook, "tblbooks"));
|
|
|
|
|
shahramkeyboard wrote: WANT TO DATA SHOW IN DATAGRID BUT IN DATASOURCE EOOR
No need to shout!
shahramkeyboard wrote: error is in line:
dataGridViewX2.DataBindings.Add(new Binding("DataSource", dsDataBook, "tblbooks"));
And what is the error? I assume it is an exception - what is the exception saying?You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
you have shown lots of useless code and wasted three hours already. You should have given detailed symptoms in your very first message. We still don't know what error occurred. If it is an exception, show all of the Exception.ToString() output and point at the right line of code.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:32am.
|
|
|
|
|
error text is:Argument Eception Was Unhandled
Cannot bind to the property or column tblmembers on the DataSource.
Parameter name: dataMember
|
|
|
|
|
Does this not suggest to you what the problem is?
Have a look at your database. Does it have a table called "tblmembers"? Does your connection actually connect to the database at all? Does the database exist?You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
yes
i can save record in database
but i can not view in datagrid
|
|
|
|
|
shahramkeyboard wrote:
String selectStr = "UPDATE " + thisTable +
" set " + book_name + " = '" + book.Bookname + "'" +
", " + book_nasher + " = '" + book.Nasher + "'" +
", " + book_motarjem + " = '" + book.Motarjem + "'" +
", " + book_shabok + " = '" + book.Shabok + "'" +
", " + book_mozo + " = '" + book.Mozo + "'" +
" where book_code = '" + book.Bookcode + "'";
shahramkeyboard wrote:
String selectStr = "select * from " + thisTable +
" where code_book = '" + argStr + "'";
shahramkeyboard wrote: String selectStr = "select * from " + thisTable + "'";
SQL injection. What happens if somebody decides to set argStr to ' DROP TABLE tblbooks; ? You might want to use parameterised queries instead of just crossing your fingers and hoping that the user will play nice.
|
|
|
|
|
is it possable to import another program i built in c# into a diffrent c# project <br />
<br />
so that i have my main program then a sub program inside <br />
<br />
<br />
ive built a web browser and download manager in to seperate projects<br />
id like to put a the two together to make one program<br />
<br />
<a href="http://tinypic.com/view.php?pic=6jpvkh&s=5">http:
<br />
Ive also tried everything to post a screen shot but the html in there some copy it to browser to see what i mean
|
|
|
|
|
You can always add any existing project to another one.
Just in case, keep a backup of the projects. Use VS File menu to add 1 exisitng project to other.
|
|
|
|
|
Yes - the easiest way is:
1) Right click on you solution in the Solution explorer window.
2) Hover the mouse over "Add", and select "Existing Project".
3) Use the dialog as you would expect.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
How can i change the form Header heigh ? ( in C# )
|
|
|
|
|
If you mean the titlebar, then the answer is you can't. However, you can create your own custom titlebar very easily by using components from the toolbox (panels, buttons etc.), and you can make your titlebar as big as you want. Just set the FormBorderStyle to none to hide all borders (including the titlebar), and you're ready to go. Kristian Sixhoej
"You can always become better." - Tiger Woods
|
|
|
|
|
Hello all,
Am creating mouse events. My application allows the user to draw a line. Then a will convert that line into a rectangle. The user may start drawing from anywhere with any angle. So using the draw rectangle i cannot draw that. because, when user draws a line, i should convert that line to a rectangle by drawing 2 lines parallel to the user's line, each on both the sides. and then join those points to form a rectangle.
So i need to draw a line parallel to existing line. How can i do that.....?
|
|
|
|
|
that is simpel. As you draw with original line, other line shoud have two point more or less than original, other two should be same
|
|
|
|
|
|
As the user draws the line, create two more lines with same X coordinate but different Y coordinates. To draw line above the user's, use a lesser value of Y coordinate and higher value to draw below it.
To draw the other two lines to complete the rectangle, draw lines with following coordinates:
Line 1: From start X of any of the lines(since they are same) and Y coordinate of top line to same start X and Y coordinate of lower most line.
Line 2:End X and Y coordinates of top and lowermost line.
|
|
|
|
|
|
v17.poornima wrote: he user may start drawing from anywhere with any angle. So using the draw rectangle i cannot draw that.
Yes you can!
private Point startPoint = new Point(0,0);
private Point endPoint = new Point(0,0);
private bool drawing = false;
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
startPoint = e.Location;
endPoint = e.Location;
panel1.Invalidate();
drawing = true;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (drawing)
{
endPoint = e.Location;
panel1.Invalidate();
}
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
drawing = false;
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
if (!((startPoint.X == endPoint.X) && (startPoint.Y == endPoint.Y)))
{
Rectangle r = new Rectangle(startPoint.X, startPoint.Y, endPoint.X - startPoint.X, endPoint.Y - startPoint.Y);
e.Graphics.DrawRectangle(Pens.Black, r);
}
}
This only draws the rectangle in one quadrant of the four possible, but it is a simple matter to ensure it draws in all four.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
If I understand you correctly, you want to draw a rectangle at the angle defined by a line.
You will need to do some Cartesian geometry and draw 4 lines to construct a rectangle.
Graphics.DrawRectangle() will not help in this case.
Nick----------------------------------
Be excellent to each other
|
|
|
|
|
|
Hi All,
After posting a question on here a day ago I kept on wondering did I use the right terminology to communicate my problem? Am I confusing you all by what I'm trying to convey? What wording should I be using to convey the subject matter at hand? These are my questions I have for this post. For instance saying I'm calling a CR 11.5 object in my win application, is that the correct way of putting it? Here's the post:
I have this Crystal Reports Utility that is helping us convert reports from 9 to 11.5 and then up to CR2008. I know this sounds strange but it was the time line of when the utility was created in. Ok so in this application both CR 11.5 and CR 2008 objects (dlls) are being used. The app first calls 11.5 reportdocument object, does some work and attempts to close the com object with Marshall.Interop.Release(com object) and then proceeds to call a CR2008 object. When it does try to instantiate a CR2008 object I get a com error. It seems as if, one the GC is not disposing of 11.5 reportdocuement object yet and two there must be some common crystal reports dll being shared between the two versions. Does this sound like a fair assessment of the situation? Outside of shutting down the app and running each procedure separately which just confirms the dll conflict. How else can I confirm that this is happening?
So I'm not interested so much about this issue as I am in trying to explain it. This means a lot to me since communication is one of the keys to being a good programmer. At least in my eyes.
DotNetMan
|
|
|
|
|
You get points for the creative repost. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Nope I'm being truly honest here. I'm more interested at this point in knowing if
I'm getting the point across.
DotNetMan
|
|
|
|