|
Does the query return multiple TechnicalSkills for each employee?
In that case, are you also iterating over the various instances of TechnicalSkills per user?
(you're not as of what you've showed us so far).
Or are you showing only one user at a time?
The query should return a table consisting of rows equal to the amount of technical skills for that user, unless you store all the skill ids in one column with a seperator.
falles01 wrote: if (adoDR["TechnicalSkillsID"])
What's this line supposed to check for?
falles01 wrote: if (techSkillsCheckListBox2.Items.Equals(adoDR["TechnicalSkillsID"].ToString()))
And this if statement compares a Collection of CheckedListBoxItems with a string.
-Larantz-
|
|
|
|
|
well I actually do need multiple entries /skills in the database yes but I am not sure how to do that part either. I have created a new table and have employeeID and TechnicalSkillsID bu thats as far as I've gotten. I haven't written any code for it. Can you help in that department at all? The skills will be saved to the database by checking checkedlistboxes. I am also using dataadapters. Once I've gotten that part right, will it fix the problem of automatically checking the checkedlist box for a given employees skills?
Thank you
|
|
|
|
|
First of all you should decide whether you want the TechnicalSkillsID as a column in the employees table - as you have now. If you keep it that way, and you want one empolyee to be able to own several TechnicalSkills, you'll have to store several ID's with a separating value.
A better approach, if you ask me, would be to remove the TechnicalSkillsID column from the employee table entirely, and rather create a TechnicalSkills table which uses the employeeID as a keyvalue. Then add one boolean column per technical skill that you want available.
You could then use the column name as a the name of the CheckedListBoxItem and set the Checked property according to the value from the database.
I'll write an example of the latter one:
Create a query for retrieving the row from the TechnicalSkill table with a employeeID equal to the employee you want to configure skills for.
Code for propagating and setting the value for CheckedListBoxItems:
... generate and execute the query for returning the techskills for the given employee
DataTable techSkillsTable = myDataSet.Tables[0];
foreach(DataRow row in techSkillsTable.Rows)
{
foreach (DataColumn column in techSkillsTable.Columns)
{
string techSkillName = column.ColumnName;
bool userHasSkill = false;
try
{
userHasSkill = Convert.ToBoolean(row[column]);
}
catch
{
}
techSkillsListBox.Items.Add(techSkillName, userHasSkill);
}
}
Hope it can be of some help.
Best regards!
-Larantz-
|
|
|
|
|
Good evening everyone,
Just migrated from Oracle8 to Oracle9i and have a problem while running this line now "which I didnt have in Oracle8!!"..
OracleConnection ConnectMe = new OracleConnection("Data Source=orcl; Persist Security Info=True;User ID=DLDSP; Password=DLDSP;Unicode=True");
ConnectMe.Open();
It says: OCI.Dll, The specified module could not be found (twice) and then it breaks down and gives me:
OCIEnvCreate failed with return code -1 but error message text was not available.
Many thanks guys
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
You could always do a select before you do the insert, but this is no guarantee that the data isn't being inserted by another user at the same time. Take a look at phantom data to see what I mean.
Alternatively, you could put a unique index on the field and let that take care of it. This isn't a nice option because it would result in an exception being thrown which you would need to deal with.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: You could always do a select before you do the insert, but this is no guarantee that the data isn't being inserted by another user at the same time.
He could also create a datalayer for database communication and let all modifications go through there with a lock to avoid simultaneous insertions.
-Larantz-
|
|
|
|
|
The problem is that a datalayer doesn't always guarantee that this happens. It really depends on the architecture, but suppose that the datalayer was consumed by web services, then there is no guarantee that this situation would not still occur.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey
Ok first a confession I have got a bit Giddy with GDI so like using it for lots of things as it is simple but effective. However last year I made a small image manipulation application in Borland C++. I would like to over the following months build quite a complex one using C#.
Now I know there is a picture box control but I would also like to allow the user to draw things such as simple 2D and 3D shapes etc - my question is this:
Is the picture box control flexible enough for this or would I be better making my own control (say a white background and then drawing on it as the user wishes using GDI) or is there a better built in control?
Thanks
Dan
**Edit - basically what I would like to be able to do is ask any pixel inside a control its colour and also to set its colour
-- modified at 16:15 Thursday 6th September, 2007
|
|
|
|
|
No,the picture box control is useless, handle your own paint event and draw your own image.
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 )
|
|
|
|
|
DanB1983 wrote: **Edit - basically what I would like to be able to do is ask any pixel inside a control its colour and also to set its colour
Basically, you need to read my image processing articles to learn how to most efficiently do that, or you need to use the GetPixel method on the image class.
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 )
|
|
|
|
|
|
Hi,
I have a sqlserver database table Students with 4colummns: [studentid], [studentname], [studentaddress], [studenttel].
i want to read all the records from this table, make textboxes and put the data into these textboxes.
can somebody help pls?
Djavid j
|
|
|
|
|
You mean to use textboxes set to multiline with all studentids in one textbox?
Or one textbox per value which would result in 4 textboxes multiplied with the amount of rows in your table.
Anyhow - you should use a SQL adapter to retrieve the dataset, and then iterate over the rows in the table to read the values and fill them into your textboxes.
-Larantz-
|
|
|
|
|
Unless you know for a fact that the amount of rows in the table will be of a managable size, you might end up with hundreds of textboxes. (4 textboxes multiplied with the amount of rows).
You can get the amount of rows through the DataSet.Tables[<table index here>].Rows.Count property.
You'd be better off showing the data through either 4 textboxes set to multiline, or even better 4 ListViews, or the best alternative being a DataGridView.
To loop through the rows and retrieve data you could do the following:
... in the method where you process your dataset data ...
DataTable table = yourDataSet.Tables[int tableindex];
int rowCounter = 0;
foreach(DataRow row in table.Rows)
{
foreach(DataColumn column in table.Columns)
{
TextBox textBox = CreateValueTextbox(
column.ColumnName + rowCounter,
row[column.ColumnName]);
this.Controls.Add(textBox);
rowCounter++;
}
}
...
private TextBox CreateValueTextbox(string textBoxName, string value)
{
TextBox textBox = new TextBox();
textBox.Name = textBoxName;
textBox.Text = value;
return textBox;
}
NB!
I haven't compiled this so I might have missed something
Hope some of it can be of help.
Best of luck!
-Larantz-
-- modified at 18:19 Thursday 6th September, 2007
Btw - there's no handling of the location of the textboxes, so you'd have to add that yourself.
As of now they'll be placed on top of eachother.
modified on Wednesday, January 16, 2008 10:20:29 AM
|
|
|
|
|
Larantz thanx it was great help
|
|
|
|
|
more of an ADO.NET question[^] you can draw the text boxes dynamically (not that hard if you have problems see: here[^] will show how to create buttons then you can change the controls to anything else)
|
|
|
|
|
I was create many web controls with LoadControl() and I put these inside panel when Page_Load(),
each control have UpdatePanel for change the content of that control,
but when the event generated by UpdatePanel occurs, the Control dont exists.
Any idea, thanks.
Pandacad, a beginer in programing world 
|
|
|
|
|
Odd question, I know. But I cannot find help with this anywhere. I need, upon right click of a datagrid, to be able to have a context menu pop up (which I know how to do) but within this context menu I want to include the Word Filter, then right next to that have a textbox which one can enter text into for filtering.
If you need an example, Microsoft Access uses this function. I have searched high and low for a solution to this and *any* suggestions or samples would be wonderful.
Thanks!
Aaron
|
|
|
|
|
Hi,
does any body know, how i can prevent that links are opened in new windows?
I want all links to be opened in the same window of my form with the webcontrol.
|
|
|
|
|
Use the navigating event, check the WebBrowserNavigatingEventArgs its .TargetFrameName to see if it match the main window or a subframe within it. If there is a name mismatch then you just set .Cancel=true; and it'll stop without loading the url...
|
|
|
|
|
Hi,
What i want to be able to do is compare two images.
eg: image == Properties.Resources.backupImage
But if i do this, since image is a System.Drawing.Image object, it will always be false. Any ideas how to do this?
Regards,
Gareth.
|
|
|
|
|
What is it exactly that you're trying to achieve. Do you really want to compare the content of the picture, as in .. 'find the seven differences' or do you want to compare the filesize, filename .. that sort of things.
|
|
|
|
|
Hi Gareth,
I think you better provide more contextual info before we try and answer this one...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
The reason it's not working, I think, is because Properties.Resources.SomeImage will always return a newly constructed image. That's why (Properties.Resources.SomeImage != Properties.Resources.SomeImage)
You'll want to try something like this:
Image backupImage = Properties.Resources.backupImage;
bool equal = image == backupImage;
|
|
|
|
|
I've googled and can't find any solutions that work.
I have a class called People that has two public properties of type string - Firstname and Surname.
I have a second class PeopleCollection : ArrayList that is an ArrayList of People objects.
Using the IComparable interface and CompareTo methods on the People class I can successfully sort by either property by specifying .Firstname or .Surname in the CompareTo method.
What I need to be able to do is sort on both fields so if the PeopleCollection instance held this data:
item[0].Firstname = "Dave" | item[0].Surname = "Smith"
item[1].Firstname = "Dave" | item[1].Surname = "Jones"
item[2].Firstname = "Andrew" | item[2].Surname = "Jones"
item[3].Firstname = "Andrew" | item[3].Surname = "Zzz"
after sorting it would be:
item[0].Firstname = "Andrew" | item[0].Surname = "Jones"
item[1].Firstname = "Andrew" | item[1].Surname = "Zzz"
item[2].Firstname = "Dave" | item[2].Surname = "Jones"
item[3].Firstname = "Dave" | item[3].Surname = "Smith"
Both columns sorted with field1 (Firstname) having priority and field2 being 'subsorted'.
I'm sure this is posible using IComparer but I just can't figure it out!
Dave
|
|
|
|