|
Hello, everyone! I am writing a interface to manager a invoice system database in Access.
I have a customer table and address table. Every customer may have several addresses. The delete, update rules are cascade.
If I delete a customer, the related addresses will be deleted at the same time. An error happens when update the address table which says "Concurrency Violation: the delete conmmand affected 0 records". I know this could be caused by the constraint relation. But I don't know how to avoid this happen. Any idea please???
Thanks in advance!
Asura
|
|
|
|
|
Hi,
I have a hashtable which store the object key and the object itself. Lets say, the map store id and the Student object. And there will be other objects which will refer
to the student objects in the hashmap. And how can I know
that whether the student object in the hashtable are not referred by other object, so that I can remove the student in the hashtable ?
Thanks
|
|
|
|
|
Make a control object that contains a counter and a reference to a student object. Store the control objects in the hash table, and use the counter to keep track of the references to the object. Each time you add a reference to it, increase the counter, and each time you remove a reference, decrement the counter. All objects where the counter is zero has no references, and can be removed.
---
b { font-weight: normal; }
|
|
|
|
|
Hello, somebody can help me with a development that I am doing for pockets. porblema is that necisto to find the way to consult the external ram memory and memories of pocket PC}. somebody knows some libreria that it can consult this. I thank for the aid to them.
|
|
|
|
|
Hi
I want to implement logging framework in a .NET application. The logs should go in a SQL Server database.
How can I do that? Any reliable sample links? Thanks in advance.
Pankaj
|
|
|
|
|
It's already been done in the Enterprise Library, Logging and Instrumentation Application Block, found here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
HI all,
How to get match percentage between two string using c# or vb.net.I need it urgently.Thanks in advance.
Ashok Mohanty
|
|
|
|
|
Match percentage? Based on what comparison of the strings?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
In a Windows Forms application we have a MDI area where multiple forms can be opened up at one time. Often the users want to toggle from one form to another and asked us to put some custom toolbar buttons similar to what you see on your web browser on the main application toolbar in order to achieve this behavior. I know that you can toggle nicely using the Control+Tab (forwards) or Control+Shift+Tab (backwards) Keys. However, I want to mimic that same exact behavior when the user clicks on the toolbar buttons.
I tried to achieve this by using the Activate() method on an individual MDI form after getting all of the MDI forms and determining which needed to be sent to the front. This works, but when you Maximize a single MDI Form and try to use Activate() it shows this distracting flashing when you are toggling between the MDI forms. Does anyone know how to fire the Windows key event for Control+Tab or Control+Shift+Tab from within the clicked event of a toolbar button?
Many thanks,
Lee
|
|
|
|
|
I guess you could try SelectNextControl on the MDI parent form (or is it the MDI client, I would guess). I don't know it if will work (probaby not), but try it.
If it doesn't work, you have the array of MDI children (in the MdiChildren property.) Find the current active child (ActiveMdiChild ) in the array, and then ActivateMdiChild the previous or the next in the array. It's not so hard:
void SelectNextMdiChild(bool next)
{
if(MdiChildren.Length <= 1)
return;
From current = ActiveMdiChild;
for(int i = 0; i < MdiChildren.Lenght; i++)
{
if(MdiChildren[i] == current)
{
if(!next && i == 0)
{
ActivateMdiChild(MdiChildren[MdiChildren.Length - 1])
}
else if(next && i == MdiChildren.Length - 1)
{
ActivateMdiChild(MdiChildren[0]);
}
else
{
if(next)
ActivateMdiChild(MdiChildren[i + 1]);
else
ActivateMdiChild(MdiChildren[i - 1]);
}
return;
}
}
} I just wrote that code and didn't test it, but it should achieve your desired effect.
Good luck!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hello, all!
I have 2 comboBoxes with the same itemCollection: Px, Py and Pz. They where built so that if I choose Px in comboBox1 the itemCollection in comboBox2 is only Py and Pz. To do this I created an event (DropDown event) for each of the comboBoxes that clears the itemCollection of the other comboBox and rebuilts it without the selectedItem of the comboBox that triggered the event.
This works just fine if the comboBoxes are DropDown, but it doesn't prevent the user from writing anything in the comboBoxes!
To make the comboBoxes readOnly I had to make them DropDownList, but when I click one of them the selectedItem disappears, wich means I can leave the comboBox without any selectedItem!
Any ideas on solving this problem? Or do I have to keep the comboBoxes DropDown and create another event (which one?) that prevents the user from writing anything in the comboBoxes?
Thank you in advance,
Patrícia Gonçalves
|
|
|
|
|
Hello!
You'll have to set the SelectedIndex property of the ComboBox whose items you've rebuilt afterwards.
Regards,
mav
|
|
|
|
|
Thanks! I saved the selectedItem in a temporary string (t), rebuilt the itemsCollection and set the selectedItem of the comboBox to t.
Is this what you ment? Anyway... it worked! Thank you!
|
|
|
|
|
Hello,
I have:
foreach (DataRowView row in this.dataview) {<br />
for (int i = 0; i < row.Row.Table.Columns.Count; i++) {<br />
if (row["NumUnits"].ToString().Length == 0 || row["MonthsToService"].ToString().Length == 0) {<br />
<br />
break;<br />
}<br />
}
}
Is there a way of getting the index of the row within the IF statement?
Thank you
|
|
|
|
|
There is no built in function for that. Add a counter that you increment for each row.
---
b { font-weight: normal; }
|
|
|
|
|
Agreed. The IndexOf () is available in .NET framework 2.0.
You will have to iterate and compare to get the Row index.
Live Life King Size
Alomgir Miah
|
|
|
|
|
|
Hello there
I am some how stuck to get the attribute values of the node. rest every thing is fine . this is the code
the XML is like this (just ruff idea)
<country>
<city name="abc" location="Somewhere">
XPathDocument xdoc = new XPathDocument(reader);
XPathNavigator nav = xdoc.CreateNavigator();
XPathNodeIterator nodeItor = nav.Select("Country/City");
Now I want to get the name attribute and location attribute.
please help me out.
thanks in Advance
|
|
|
|
|
missed the XML due to tags
<Country>
<City Name="abc" location="xyz">
</Country>
|
|
|
|
|
|
Hello all
I have a Datatable, along with datarow and dataview defined:
<br />
DataTable dt = new DataTable();<br />
DataRow dr;<br />
DataView dv = new DataView();<br />
The Datatable is given these columns:
<br />
dt.Columns.Add(new DataColumn ("ID", typeof(string)));<br />
dt.Columns.Add(new DataColumn ("Antal", typeof(int)));<br />
dt.Columns.Add(new DataColumn ("belopp", typeof(string))<br />
After filling the table with data I make a view:
<br />
dv = new DataView(dt);<br />
... and then I sort it:
<br />
dv.Sort = "Antal DESC";<br />
My problem is, the sortin doesnt seem to work, when I print every row starting from the first I still get results like this:
antal<br />
2<br />
1<br />
2<br />
4<br />
4<br />
1<br />
6
Can anyone see what I'm doing wrong?
|
|
|
|
|
You must keep in mind that the DataView.Sort property will just sort the DataView and the underlying DataTable is not sorted. How are you printing thiese values
antal
2
1
2
4
4
1
6
Live Life King Size
Alomgir Miah
|
|
|
|
|
yeah, im using the view and not the actual table to display data, so I dont think thats it. Here's how I do it (just for testing I might add )
string temp = "";<br />
<br />
foreach (DataRowView dvr in dv)<br />
{<br />
temp = dvr["Antal"].ToString();<br />
}
and then I run debugger to see value of temp for every row.
|
|
|
|