|
falles01 wrote: sql = "Insert into EmpSkills(EmployeeID,TechnicalSkillsID) values ('" + this.EmployeeID + "','" + techSkillsCheckListBox2.CheckedItems.ToString() + "')";
At first glance, this is vulnerable to a SQL Injection attack (not why it isn't reading from the database, though).
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
So do you know how to insert multiple values from a checkedlistbox selection?
|
|
|
|
|
What I meant by my post was that the way you are concatenating strings together into a sql statement is very bad practice. Read this very useful article http://www.codeproject.com/cs/database/SqlInjectionAttacks.asp[^] by Colin Mackay.
As far as inserting multiple values from a checklistbox selection, techSkillsCheckListBox2.CheckedItems.ToString() is suspect. Isn't there supposed to be an Items collection that you can pull the actual data value from? I am not a 100% but look for something like that.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Hey,
I am using a BinaryReader to read some Int16 values from a file. These values, however, are stored in big-endian format. I am sure there is a way to fix this issue programmatically, I'm just not sure how to go about doing it. So, how can I read a big-endian value from a file and get it to display correctly?
|
|
|
|
|
Just write a function that takes the Int16 values and converts them from big-endian to little-endian.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Ok, thank you. I was just wondering that perhaps there was a function already built into MS C# that would do it for me.
|
|
|
|
|
hi
I want implement a relation between a winform and a web application (web form).
web application is by vb.net and the winform is by c# !!!
is it possible directly or must using a web service ?
H.R
|
|
|
|
|
A webservice is your best bet.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Web service is the way to go, as Christian already mentioned.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello to all,
I wrote an application that takes measurements made by usb attached software and after finished
collecting, it draws a graph.
my problem is that while collecting, if moving from this form to another activity on my desktop
say check mail for instance, or even if screen Saver catches me, the form goes blank and I can't see
anything.
it is problematic, I have a progress bar on that form to show collecting progress, and I can't see
it because I can't see the form.
how do I make this form always visible???
thanks in advanced.
P.S
any piece of code or extra info just ask.
|
|
|
|
|
Seems to me like you are starving the main thread. The preferable solution is to use a seperate thread to read from your USB thingo and update the graph, leaving the main thread free to process windows messages (like redraw).
If you want to be really lazy, then you can just pump the messages manually using Application.DoEvents()
The MSDN[^] has a good description of what is going on in your app.
|
|
|
|
|
Thanks I'll be sure to read that.
hope it will answer my problem.
have a great day.
|
|
|
|
|
There is a table (created of variables) is necessary to insert her as picture in PictureBox. And then would be possible to drag, scale, etc this picture.
|
|
|
|
|
Seryoga wrote: There is a table (created of variables) is necessary to insert her as picture in PictureBox.
Then render it to a bitmap. A table, of any form, is not a Bitmap.
Seryoga wrote: And then would be possible to drag, scale, etc this picture.
As is often the case, you're trying to make a picture box do stuff that it plain cannot do. you will have to write a control, if you want this interactive. You may b e able to do it with buttons on the side of the picture box, but that is not nice.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus, How your answer will help to solve this problem? Everything, that you have written I know. You can offer something concrete? Or to give the information on it?
|
|
|
|
|
If you already know that, then you have to be more specific on what it is that you need help with.
---
single minded; short sighted; long gone;
|
|
|
|
|
I know what necessary, but I do not know how this to realise.
|
|
|
|
|
So, you knew you had to render your table to a bitmap ? Then why did you ask ? Why didn't you specify what form your table takes, and ask how to turn that into a bitmap ?
Try asking what you want to know, rather than asking a question whose answer you know. Try to also consider giving us the information needed to help you.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Try asking what you want to know, rather than asking a question whose answer you know.
I might use that as a sig
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
*grin* then someone got something out of this thread.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: someone got something out of this thread
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
I wrote, that I should make a picture of the table. The picture is bitmap. Therefore it is necessary to render table to a bitmap. What for to specify obvious things?
|
|
|
|
|
Specify what do you call a "table". A html table? A DataGrid? A two-dimensional array? Or approximately 704,000,000 more....
Or to be more concrete:
int[,] array = new int[3, 4];
Size size = Size;
Bitmap b = new Bitmap(size.Width, size.Height);
Graphics g = Graphics.FromImage(b);
int dataWidth = array.GetLength(0);
int dataHeight = array.GetLength(1);
for (int x = 0; x < dataWidth; x++) {
for (int y = 0; y < dataHeight; y++) {
g.DrawString(array[x, y].ToString(), Font, Brushes.Black,
(float)size.Width * x / dataWidth,
(float)size.Height * y / dataHeight}
}
BackgroundImage = b;
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Thanks for the answer.
gajatko wrote: Specify what do you call a "table". A html table? A DataGrid? A two-dimensional array? Or approximately 704,000,000 more....
A two-dimensional array.
There is any method except GDI +?
Another question:
Whether is possible in PictureBox a work with layers (approximately as in a photoshop), or for it is necessary to write the own control?
|
|
|
|
|
U can put the data to some control and then render this control to a bitmap:
int[,] array = new int[3, 4];
Size size = Size;
b = new Bitmap(size.Width, size.Height);
int dataWidth = array.GetLength(0);
int dataHeight = array.GetLength(1);
DataGridViewColumn column;
for (int x = 0; x < dataWidth; x++) {
column = new DataGridViewColumn();
column.CellTemplate = new DataGridViewTextBoxCell();
column.Name = "col" + x.ToString();
column.HeaderText = x.ToString();
column.ValueType = typeof(int);
gridView.Columns.Add(column);
}
object[] rowData;
for (int y = 0; y < dataHeight; y++) {
rowData = new object[dataWidth];
for (int x = 0; x < dataWidth; x++) {
rowData[x] = array[x, y];
}
gridView.Rows.Add(rowData);
}
gridView.DrawToBitmap(b, new Rectangle(new Point(0), gridView.Size));
BackgroundImage = b;
(where gridView is a DataGridView)
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|