|
Okay but what about my last question. how do I update the employee table wiht the ID corresponding the combobox selection.
EG. Employee table has empID, RoleID, DivisioID etc. But then I have a Role table with roleid description and role, and division table with divisionid, division etc.
When a user enters a new employee name, and selects role for example, the employee table should update with a new name and put the correct roleID against the role.
Obviously I'm not good with sql at all. 
|
|
|
|
|
I've also been advised that I can do this by creating multiple insert statements in the same block. Is this possible?
If so how?
string sql =
sql =
sql=
etc etc?????? Is this how you would do it? To me it would insert the data but it won't be related to each other. EG. I need to update the division, manager, role table when I insert a new employee. 
|
|
|
|
|
Hi!
I am trying to create an XML Element that has XML attribute and appened it to and existing XML document.
how do i do this?
Do the prosedure is:
1)create attributes (2 - 3).
2) create Element and attach the attributes? (How?)
3) append to an Element list? Or XMLDoc? (How)
Thanks 
|
|
|
|
|
|
1)
XmlAttribute myAttrib = new XmlAttribute();
myAttrib.Value = "Some value";
2) on then XmlDocument you opened (I'm going to use xmlDoc as an example)
XmlNode myNode = xmlDoc.CreateElement("tagname");
myNode.AppendChild(xmlDoc.CreateTextElement("The tag's text node Value"));
3) use the .AppendChild() as above to attach to the Document node
xmlDoc.DocumentElement.AppendChild(myNode);
*note* you need to use .Save() to well save the changes/appends
-Spacix
All your skynet questions[^] belong to solved
|
|
|
|
|
How do i attch the attribute to the new node?
is it before i append it?
Thanks 
|
|
|
|
|
look at the .Attributes.Append() method for a XmlNode...
|
|
|
|
|
hi all , how you doing ??
I need to create about 50 button every one had an image ..
my Question is how I can determine which button I pressed ?!
please give me a hint ....
and here is my code .....
private void CreateButtons()<br />
{<br />
for (int x =0 ; x < 10 ; x++)<br />
{<br />
bs = new Button();<br />
bs.ImageList = imageList1;<br />
bs.ImageIndex = x;<br />
bs.Size = new Size(17,17);<br />
bs.Location = new Point(x * 17 , 0);<br />
bs.Visible = true;<br />
bs.Click += new EventHandler(bs_Click);<br />
Controls.Add (bs);<br />
}<br />
}<br />
<br />
private void bs_Click(object sender, System.EventArgs e)<br />
{<br />
Console.WriteLine ("Which Button I pressed");<br />
<br />
}
I know nothing , I know nothing
|
|
|
|
|
build the buttons into an array of buttons?
I think you can do this...
Button[] bs = new Button[10];
for (int x = 0; x < 10; x++)
{
bs[x] = new Button();
bs[i].ImageList = imageList1;
bs[x].ImageIndex = x;
bs[x].Size = new Size(17, 17);
bs[x].Location = new Point(x * 17, 0);
bs[x].Visible = true;
bs[x].Click += new EventHandler(bs_Click);
Controls.Add (bs);
}
private void bs_Click(object sender, System.EventArgs e)
{
Console.WriteLine ("The Button I pressed is {0}", sender.ToString().Split(',')[0].Split('.')[4]);
}
edit: to draw 50 in 5 rows of 10 stagger the array
Button[] bs = new Button[50];
for (int y = 0; y < 5; y++)
{
for (int x = 0; x < 10; x++)
{
bs[x] = new Button();
bs[i].ImageList = imageList1;
bs[x].ImageIndex = x;
bs[x].Size = new Size(17, 17);
bs[x].Location = new Point(x * 17, y * 17);
bs[x].Visible = true;
bs[x].Click += new EventHandler(bs_Click);
Controls.Add(bs);
}
}
-- modified at 17:54 Wednesday 29th August, 2007
|
|
|
|
|
thank you so much
this is exactly what i need ,
you solve a big prb ,
I know nothing , I know nothing
|
|
|
|
|
The sender object passed to the event handler is a reference to the button.
|
|
|
|
|
I tend to put a value (perhaps an int) in the Button's Tag property, then check the sender's Tag.
|
|
|
|
|
If you have "about 50 buttons" on your form, then it is a very poorly designed application. It will suffer from performance issues and more.
only two letters away from being an asset
|
|
|
|
|
thank all of you for your replay
I appreciated it ...
thanks.......
dear Mark , first thanks for advice
second the 50 button I am using in my form will be use to change Icon of Treeview Node
I mean every button has an icon or an image with dimension ( 17 , 17 )
when I click one , the Treenode item must had that button icon ...
plus my form size is 170 * 250 contains those tiny button ,
but Dear SpacixOne give me a good solution
have a good day ,
Kind regards
I know nothing , I know nothing
|
|
|
|
|
Besides the poor UI and performance, you're making the coding and maintenance much more difficult.
What happens, sometime in the future, if you remove one of the icons, or want to add more? You're left with redesigning your form to accommodate.
Have you thought about using a dropdownlist, or list view to display and select these icons? You would have one button worry about, and an easy way to maintain and enhance the application.
only two letters away from being an asset
|
|
|
|
|
hai, I have question since there were many article implementing low-level hooking in C#.
i couldn't manage to find how to determine when we click the middle button or double-clicked the mouse using low-level mouse hook.
is there any way / method to do that?
i'm using unmanaged c++ dll wrapper (WilsonGlobalHook) from this site.
thx
|
|
|
|
|
|
thankz for the answer,
but I have look throughout that article before, and those article/project only cover the "left" and "right" clicks button.
any way to determine "middle" clicks?
low-level hooking problem maybe?
|
|
|
|
|
Got it,
I'm sorry before...
the class I used only handle WM_LBUTTONDOWN / WMLBUTTONUP and WM_RBUTTONDOWN / WMRBUTTONUP..
so just modify the class a little bit and add WM_MBUTTONDOWN / MBUTTONUP and maybe the double click handler to modify it.
yeah..
thankz a lot..
|
|
|
|
|
Hi,
I am currently returning an XmlDocument from a webservice using the following:
<br />
[OperationContract]<br />
[FaultContract(typeof(Anaqua.Domain.AnaquaServiceError))]<br />
[XmlSerializerFormat]<br />
public XmlDocument GetLawUpdateGenerationXML(short versionNum)<br />
{<br />
}<br />
Then in my page that consumes the webservice I did the following:
<br />
XmlDocument doc = (XmlDocument)svc.GetLawUpdateGenerationXML(internalVersionNumber);<br />
However it is saying:
Cannot convert type 'System.Xml.XmlElement' to 'System.Xml.XmlDocument'
Now I think this is because of the serialization using[XmlSerializerFormat]
So how would I go about reading the XML into and XML Document?
Regards
Paul Custance
|
|
|
|
|
This link[^] should answer your question.
Paul
|
|
|
|
|
If you wish to append a child node to the document root of an already created XML file then
be sure to have using System.Xml;
then the following will add a node:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("path to your xml file that already had a root document node");
XmlNode newXmlNode = xmlDoc.CreateElement("tagname");
newXmlNode.AppendChild(xmlDoc.CreateTextElement("The tag's text node Value"));
xmlDoc.DocumentElement.AppendChild(newXmlNode);
|
|
|
|
|
Hi All,
Will anyone help in opening a View which is having its own Interface and Presenter. I want to open this view from base presenter in ModalWindow style. I need a sample application so that i can understand better..
Thanks in advance
Umashanker.K
|
|
|
|
|
umashankergr8 wrote: I need a sample application so that i can understand better..
Sorry. I can't create or upload the sample for you but I will tell you the steps that you need to follow to open the view in popup form. (I believe that you have some ideas about CAB (Composite UI Application Block) Frameworks and terms.)
#1. First, you need to add the View in WorkItem or ModuleWorkItem.
Dim objMyView As MyView = WorkItem.SmartParts.AddNew(Of MyView)(MyNamespace.Constants.SmartPartNames.MYVIEWID)
Note: If you are using SCSF, you can write the code above in AddView() methods.
#2. Add a form to your project and put the DeckWorkSpace in this form.
#3. Write the code below in your presenter when the view raise the event of presenter.
Dim formPopUp As New Infrastructure.UI.Form()<br />
formPopUp.Title = "MyView"<br />
formPopUp.StartPosition = FormStartPosition.CenterScreen<br />
formPopUp.FormBorderStyle = FormBorderStyle.FixedDialog<br />
formPopUp.MaximizeBox = False<br />
formPopUp.MinimizeBox = False<br />
formPopUp.ShowDialog()<br />
<br />
Note: Infrastructure.UI.Form should have one more constructor like that
<br />
Public Sub New(ByVal view As Control)<br />
Public Sub New(ByVal view As Control)<br />
InitializeComponent()<br />
<br />
Me.ClientSize = New System.Drawing.Size(view.Width, view.Height)<br />
Me.SuspendLayout()<br />
view.Dock = DockStyle.Fill<br />
<br />
'Adding View to Form<br />
'---------------------------------<br />
Me._contentPanel.Controls.Add(view) '' Note: _contentPenel is deckworkspace control.<br />
Me.ResumeLayout()<br />
'---------------------------------<br />
End Sub<br />
That's all..
Hope it helps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
...you just wrote a VB sample in the C# forum. BLASPHEMER!!!
"I need build Skynet. Plz send code"
|
|
|
|