|
Here is my SQL Command..I cut and pasted it here....Thanks
UPDATE BPlan
SET IncidentName = ?, DatePrepared = ?, IncidentLocation = ?, IncidentCommander = ?, SafetyOfficer = ?, HMGroup = ?, EnvHealth = ?,
AsstSafetyOfficer = ?, EntryLeader = ?, TechSpec = ?, DeconLeader = ?, SiteAccess = ?, SafeRefuge = ?, Entry1 = ?, Entry1PPE = ?, Entry2 = ?,
Entry2PPE = ?, Entry3 = ?, Entry3PPE = ?, Entry4 = ?, Entry4PPE = ?, Decon1 = ?, Decon1PPE = ?, Decon2 = ?, Decon2PPE = ?, Decon3 = ?,
Decon3PPE = ?, Decon4 = ?, Decon4PPE = ?, Material1 = ?, Cont1 = ?, Qty1 = ?, PhysState1 = ?, pH1 = ?, IDLH1 = ?, FP1 = ?, IT1 = ?, VP1 = ?, VD1 = ?,
SG1 = ?, LEL1 = ?, UEL1 = ?, Material2 = ?, Cont2 = ?, Qty2 = ?, PhysState2 = ?, pH2 = ?, IDLH2 = ?, FP2 = ?, IT2 = ?, VP2 = ?, VD2 = ?, SG2 = ?,
LEL2 = ?, UEL2 = ?, Material3 = ?, Cont3 = ?, Qty3 = ?, PhysState3 = ?, pH3 = ?, IDLH3 = ?, FP3 = ?, IT3 = ?, VP3 = ?, VD3 = ?, SG3 = ?, LEL3 = ?,
UEL3 = ?, Material4 = ?, Cont4 = ?, Qty4 = ?, PhysState4 = ?, pH4 = ?, IDLH4 = ?, FP4 = ?, IT4 = ?, VP4 = ?, VD4 = ?, SG4 = ?, LEL4 = ?, UEL4 = ?,
Material5 = ?, Cont5 = ?, Qty5 = ?, PhysState5 = ?, pH5 = ?, IDLH5 = ?, FP5 = ?, IT5 = ?, VP5 = ?, VD5 = ?, SG5 = ?, LEL5 = ?, UEL5 = ?,
HazRiskMemo = ?, LELInstr = ?, ToxInstr = ?, O2Instr = ?, RadInstr = ?, HazMonMemo = ?, StanDecon = ?, DeconMemo = ?, CommFreq = ?,
TacFreq = ?, EntryFreq = ?, MedMon = ?, MedTreatment = ?, MedMemo = ?, SiteMap = ?, EntryObjMemo = ?, SopsMod = ?, SOPMemo = ?,
SafProcMemo = ?, AsstSafetySign = ?, SafBriefTime = ?, HMGroupSign = ?, ICSign = ?
WHERE (IncidentName = ?) AND (DatePrepared = ? OR
? IS NULL AND DatePrepared IS NULL) AND (OperationalPeriod = ? OR
? IS NULL AND OperationalPeriod IS NULL) AND (TimePrepared = ? OR
? IS NULL AND TimePrepared IS NULL) AND (IncidentLocation = ? OR
? IS NULL AND IncidentLocation IS NULL) AND (IncidentCommander = ? OR
? IS NULL AND IncidentCommander IS NULL) AND (SafetyOfficer = ? OR
? IS NULL AND SafetyOfficer IS NULL) AND (HMGroup = ? OR
? IS NULL AND HMGroup IS NULL) AND (EnvHealth = ? OR
? IS NULL AND EnvHealth IS NULL) AND (AsstSafetyOfficer = ? OR
? IS NULL AND AsstSafetyOfficer IS NULL) AND (EntryLeader = ? OR
? IS NULL AND EntryLeader IS NULL) AND (TechSpec = ? OR
? IS NULL AND TechSpec IS NULL) AND (DeconLeader = ? OR
? IS NULL AND DeconLeader IS NULL) AND (SiteAccess = ? OR
? IS NULL AND SiteAccess IS NULL) AND (SafeRefuge = ? OR
? IS NULL AND SafeRefuge IS NULL) AND (Entry1 = ? OR
? IS NULL AND Entry1 IS NULL) AND (Entry1PPE = ? OR
? IS NULL AND Entry1PPE IS NULL) AND (Entry2 = ? OR
? IS NULL AND Entry2 IS NULL) AND (Entry2PPE = ? OR
? IS NULL AND Entry2PPE IS NULL) AND (Entry3 = ? OR
? IS NULL AND Entry3 IS NULL) AND (Entry3PPE = ? OR
? IS NULL AND Entry3PPE IS NULL) AND (Entry4 = ? OR
? IS NULL AND Entry4 IS NULL) AND (Entry4PPE = ? OR
? IS NULL AND Entry4PPE IS NULL) AND (Decon1 = ? OR
? IS NULL AND Decon1 IS NULL) AND (Decon1PPE = ? OR
? IS NULL AND Decon1PPE IS NULL) AND (Decon2 = ? OR
? IS NULL AND Decon2 IS NULL) AND (Decon2PPE = ? OR
? IS NULL AND Decon2PPE IS NULL) AND (Decon3 = ? OR
? IS NULL AND Decon3 IS NULL) AND (Decon3PPE = ? OR
? IS NULL AND Decon3PPE IS NULL) AND (Decon4 = ? OR
? IS NULL AND Decon4 IS NULL) AND (Decon4PPE = ? OR
? IS NULL AND Decon4PPE IS NULL) AND (Material1 = ? OR
? IS NULL AND Material1 IS NULL) AND (Cont1 = ? OR
? IS NULL AND Cont1 IS NULL) AND (Qty1 = ? OR
? IS NULL AND Qty1 IS NULL) AND (PhysState1 = ? OR
? IS NULL AND PhysState1 IS NULL) AND (pH1 = ? OR
? IS NULL AND pH1 IS NULL) AND (IDLH1 = ? OR
? IS NULL AND IDLH1 IS NULL) AND (FP1 = ? OR
? IS NULL AND FP1 IS NULL) AND (IT1 = ? OR
? IS NULL AND IT1 IS NULL) AND (VP1 = ? OR
? IS NULL AND VP1 IS NULL) AND (VD1 = ? OR
? IS NULL AND VD1 IS NULL) AND (SG1 = ? OR
? IS NULL AND SG1 IS NULL) AND (LEL1 = ? OR
? IS NULL AND LEL1 IS NULL) AND (UEL1 = ? OR
? IS NULL AND UEL1 IS NULL) AND (Material2 = ? OR
? IS NULL AND Material2 IS NULL) AND (Cont2 = ? OR
? IS NULL AND Cont2 IS NULL) AND (Qty2 = ? OR
? IS NULL AND Qty2 IS NULL) AND (PhysState2 = ? OR
? IS NULL AND PhysState2 IS NULL) AND (pH2 = ? OR
? IS NULL AND pH2 IS NULL) AND (IDLH2 = ? OR
? IS NULL AND IDLH2 IS NULL) AND (FP2 = ? OR
? IS NULL AND FP2 IS NULL) AND (IT2 = ? OR
? IS NULL AND IT2 IS NULL) AND (VP2 = ? OR
? IS NULL AND VP2 IS NULL) AND (VD2 = ? OR
? IS NULL AND VD2 IS NULL) AND (SG2 = ? OR
? IS NULL AND SG2 IS NULL) AND (LEL2 = ? OR
? IS NULL AND LEL2 IS NULL) AND (UEL2 = ? OR
? IS NULL AND UEL2 IS NULL) AND (Material3 = ? OR
? IS NULL AND Material3 IS NULL) AND (Cont3 = ? OR
? IS NULL AND Cont3 IS NULL) AND (Qty3 = ? OR
? IS NULL AND Qty3 IS NULL) AND (PhysState3 = ? OR
? IS NULL AND PhysState3 IS NULL) AND (pH3 = ? OR
? IS NULL AND pH3 IS NULL) AND (IDLH3 = ? OR
? IS NULL AND IDLH3 IS NULL) AND (FP3 = ? OR
? IS NULL AND FP3 IS NULL) AND (IT3 = ? OR
? IS NULL AND IT3 IS NULL) AND (VP3 = ? OR
? IS NULL AND VP3 IS NULL) AND (VD3 = ? OR
? IS NULL AND VD3 IS NULL) AND (SG3 = ? OR
? IS NULL AND SG3 IS NULL) AND (LEL3 = ? OR
? IS NULL AND LEL3 IS NULL) AND (UEL3 = ? OR
? IS NULL AND UEL3 IS NULL) AND (Material4 = ? OR
? IS NULL AND Material4 IS NULL) AND (Cont4 = ? OR
? IS NULL AND Cont4 IS NULL) AND (Qty4 = ? OR
? IS NULL AND Qty4 IS NULL) AND (PhysState4 = ? OR
? IS NULL AND PhysState4 IS NULL) AND (pH4 = ? OR
? IS NULL AND pH4 IS NULL) AND (IDLH4 = ? OR
? IS NULL AND IDLH4 IS NULL) AND (FP4 = ? OR
? IS NULL AND FP4 IS NULL) AND (IT4 = ? OR
? IS NULL AND IT4 IS NULL) AND (VP4 = ? OR
? IS NULL AND VP4 IS NULL) AND (VD4 = ? OR
? IS NULL AND VD4 IS NULL) AND (SG4 = ? OR
? IS NULL AND SG4 IS NULL) AND (LEL4 = ? OR
? IS NULL AND LEL4 IS NULL) AND (UEL4 = ? OR
? IS NULL AND UEL4 IS NULL) AND (Material5 = ? OR
? IS NULL AND Material5 IS NULL) AND (Cont5 = ? OR
? IS NULL AND Cont5 IS NULL) AND (Qty5 = ? OR
? IS NULL AND Qty5 IS NULL) AND (PhysState5 = ? OR
? IS NULL AND PhysState5 IS NULL) AND (pH5 = ? OR
? IS NULL AND pH5 IS NULL) AND (IDLH5 = ? OR
? IS NULL AND IDLH5 IS NULL) AND (FP5 = ? OR
? IS NULL AND FP5 IS NULL) AND (IT5 = ? OR
? IS NULL AND IT5 IS NULL) AND (VP5 = ? OR
? IS NULL AND VP5 IS NULL) AND (VD5 = ? OR
? IS NULL AND VD5 IS NULL) AND (SG5 = ? OR
? IS NULL AND SG5 IS NULL) AND (LEL5 = ? OR
? IS NULL AND LEL5 IS NULL) AND (UEL5 = ? OR
? IS NULL AND UEL5 IS NULL) AND (HazRiskMemo = ? OR
? IS NULL AND HazRiskMemo IS NULL) AND (LELInstr = ? OR
? IS NULL AND LELInstr IS NULL) AND (ToxInstr = ? OR
? IS NULL AND ToxInstr IS NULL) AND (O2Instr = ? OR
? IS NULL AND O2Instr IS NULL) AND (RadInstr = ? OR
? IS NULL AND RadInstr IS NULL) AND (HazMonMemo = ? OR
? IS NULL AND HazMonMemo IS NULL) AND (StanDecon = ? OR
? IS NULL AND StanDecon IS NULL) AND (DeconMemo = ? OR
? IS NULL AND DeconMemo IS NULL) AND (CommFreq = ? OR
? IS NULL AND CommFreq IS NULL) AND (TacFreq = ? OR
? IS NULL AND TacFreq IS NULL) AND (EntryFreq = ? OR
? IS NULL AND EntryFreq IS NULL) AND (MedMon = ? OR
? IS NULL AND MedMon IS NULL) AND (MedTreatment = ? OR
? IS NULL AND MedTreatment IS NULL) AND (MedMemo = ? OR
? IS NULL AND MedMemo IS NULL) AND (SiteMap = ? OR
? IS NULL AND SiteMap IS NULL) AND (EntryObjMemo = ? OR
? IS NULL AND EntryObjMemo IS NULL) AND (SopsMod = ? OR
? IS NULL AND SopsMod IS NULL) AND (SOPMemo = ? OR
? IS NULL AND SOPMemo IS NULL) AND (SafProcMemo = ? OR
? IS NULL AND SafProcMemo IS NULL) AND (AsstSafetySign = ? OR
? IS NULL AND AsstSafetySign IS NULL) AND (SafBriefTime = ? OR
? IS NULL AND SafBriefTime IS NULL) AND (HMGroupSign = ? OR
? IS NULL AND HMGroupSign IS NULL) AND (ICSign = ? OR
? IS NULL AND ICSign IS NULL);
SELECT IncidentName, DatePrepared, OperationalPeriod, TimePrepared, IncidentLocation, IncidentCommander, SafetyOfficer, HMGroup,
EnvHealth, AsstSafetyOfficer, EntryLeader, TechSpec, DeconLeader, SiteAccess, SafeRefuge, Entry1, Entry1PPE, Entry2, Entry2PPE,
Entry3, Entry3PPE, Entry4, Entry4PPE, Decon1, Decon1PPE, Decon2, Decon2PPE, Decon3, Decon3PPE, Decon4, Decon4PPE, Material1,
Cont1, Qty1, PhysState1, pH1, IDLH1, FP1, IT1, VP1, VD1, SG1, LEL1, UEL1, Material2, Cont2, Qty2, PhysState2, pH2, IDLH2, FP2, IT2,
VP2, VD2, SG2, LEL2, UEL2, Material3, Cont3, Qty3, PhysState3, pH3, IDLH3, FP3, IT3, VP3, VD3, SG3, LEL3, UEL3, Material4, Cont4, Qty4,
PhysState4, pH4, IDLH4, FP4, IT4, VP4, VD4, SG4, LEL4, UEL4, Material5, Cont5, Qty5, PhysState5, pH5, IDLH5, FP5, IT5, VP5, VD5, SG5,
LEL5, UEL5, HazRiskMemo, LELInstr, ToxInstr, O2Instr, RadInstr, HazMonMemo, StanDecon, DeconMemo, CommFreq, TacFreq,
EntryFreq, MedMon, MedTreatment, MedMemo, SiteMap, EntryObjMemo, SopsMod, SOPMemo, SafProcMemo, AsstSafetySign,
SafBriefTime, HMGroupSign, ICSign
FROM BPlan
Mark Garcia
|
|
|
|
|
Well, I have no idea. But I would suspect and start researching the possibility that you've either hit a statement length limit or a limit on the number of parameters, or a limit on the complexity of the statement. You could get away with something like this in SQL Server. I'm not so sure about the Jet database engine.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks.... I'll check that out...
|
|
|
|
|
I have a windows form and the first thing I want to happen is for a MessageBox to ask a Yes/No question after the form loads. However, I want the form to fully render itself before the MessageBox pops up. If I put the MessageBox.Show in the form constructor or in the form's Load method, the MessageBox appears first thing and the form does not appear until the user answers the MessageBox.
What do I need to do?
Thanks,
Mark Mokris
|
|
|
|
|
Hello,
Maybe you could call the Form's Invalidate method before showing the messasge box.
Peter
|
|
|
|
|
Is the form supposed to wait on the message box to do something? If not, you can create a thread to show the message box. This will assure that your app will paint itself in the background. Make sure the messagebox is on top though.
|
|
|
|
|
|
I am trying to write then read my first XML file. It is meant to store settings for a device. The user will store stuff to the file, then maybe load it back and transmit it to the target board. Sounds pretty simple.
My question is how to parse this guy. How do I get the data back out so I can plop it on the forms I've created? I see how to rifle through the file, but now how the heck to see where I am. I'm very new to this, so a real-world example would be great.
Here's how I'm setting up to do the read.
StreamReader stream = new StreamReader(fi.FullName);
XmlTextReader reader = new XmlTextReader(stream);
XmlSchemaCollection schemaColl = new XmlSchemaCollection();
schemaColl.Add(null,"XMLSchema_LCData.xsd");
XmlValidatingReader valReader = new XmlValidatingReader(reader);
valReader.ValidationType = ValidationType.Schema;
valReader.Schemas.Add(schemaColl);
valReader.ValidationEventHandler += new ValidationEventHandler(valHandler);
while (valReader.Read())
{
// Now what? How would I know that I have some certain piece of data?
// Pretend I want to know that is the FINV0 for CreepB from the XML file.
}
Here's the XML file I am trying to parse:
<xmlschema_lcdata xmlns="http://tempuri.org/XMLSchema_LCData.xsd">
<datesaved>2/25/2005 1:51:54 PM
<softwarename>X-RES
<softwarepartnumber> 172814r
<softwareversion>0.1.0
<serialnumber>someCell
<partnumber>somenumber
<ad_configuration>
<roughcal>40.591
<tempgain>11.95457
<tempoffset>-884002
<tempoffset>16
<inputqr>40
<outputdecimator>1
<temperaturedecimator>8
<temperatureqr>10
<ad_runtime>
<retrainthreshold>120
<hysteresisthreshold>60
<noiserequirement>4
<openloopqr>255
<maxqr>70
<minqr>20
<systemtc>
<za>169666
<zb>0.01226807
<zc>-4.305039E-07
<sb>4.582489E-08
<sc>-5.763168E-13
<linearity>
<cor>1.255103E-10
<gain>0.9998779
<creep>
<creepa>
<finv0>6.496906E-05
<finv1>0
<finv2>0
<tau0>0.001777649
<tau1>0
<tau2>0
<creepb>
<finv0>4.994869E-05
<finv1>0
<finv2>0
<tau0>0.0001777411
<tau1>0
<tau2>0
<creepc>
<finv0>9.953976E-06
<finv1>0
<finv2>0
<tau0>5.924702E-05
<tau1>0
<tau2>0
<hysteresis>
<zero>119020
968630
<guardband>200
<increasing>
<a_term>0
<b_term>0
<c_term>0
<e_term>-1.065821E-12
<increasing>
<a_term>8E-05
<b_term>-8.259087E-11
<c_term>0
<e_term>-1.065821E-12
Any help?
Kenny O'Dell
Sr. R&D Software Engineer
Mettler-Toledo Inc.
Inman, SC
|
|
|
|
|
Sorry, didn't realize is was going to strip out the XML stuff. I'll try again.
I am trying to write then read my first XML file. It is meant to store settings for a device. The user will store stuff to the file, then maybe load it back and transmit it to the target board. Sounds pretty simple.
My question is how to parse this guy. How do I get the data back out so I can plop it on the forms I've created? I see how to rifle through the file, but now how the heck to see where I am. I'm very new to this, so a real-world example would be great.
Here's how I'm setting up to do the read.
StreamReader stream = new StreamReader(fi.FullName);
XmlTextReader reader = new XmlTextReader(stream);
XmlSchemaCollection schemaColl = new XmlSchemaCollection();
schemaColl.Add(null,"XMLSchema_LCData.xsd");
XmlValidatingReader valReader = new XmlValidatingReader(reader);
valReader.ValidationType = ValidationType.Schema;
valReader.Schemas.Add(schemaColl);
valReader.ValidationEventHandler += new ValidationEventHandler(valHandler);
while (valReader.Read())
{
// Now what? How would I know that I have some certain piece of data?
// Pretend I want to know that is the FINV0 for CreepB from the XML file.
}
Here's the XML file I am trying to parse:
<?xml version="1.0"?>
<XMLSchema_LCData xmlns="http://tempuri.org/XMLSchema_LCData.xsd">
<DateSaved>2/25/2005 1:51:54 PM</DateSaved>
<SoftwareName>X-RES</SoftwareName>
<SoftwarePartNumber> 172814r</SoftwarePartNumber>
<SoftwareVersion>0.1.0</SoftwareVersion>
<SerialNumber>someCell</SerialNumber>
<PartNumber>somenumber</PartNumber>
<AD_Configuration>
<RoughCal>40.591</RoughCal>
<TempGain>11.95457</TempGain>
<TempOffset>-884002</TempOffset>
<TempOffset>16</TempOffset>
<InputQR>40</InputQR>
<OutputDecimator>1</OutputDecimator>
<TemperatureDecimator>8</TemperatureDecimator>
<TemperatureQR>10</TemperatureQR>
</AD_Configuration>
<AD_Runtime>
<RetrainThreshold>120</RetrainThreshold>
<HysteresisThreshold>60</HysteresisThreshold>
<NoiseRequirement>4</NoiseRequirement>
<OpenLoopQR>255</OpenLoopQR>
<MaxQR>70</MaxQR>
<MinQR>20</MinQR>
</AD_Runtime>
<SystemTC>
<ZA>169666</ZA>
<ZB>0.01226807</ZB>
<ZC>-4.305039E-07</ZC>
<SB>4.582489E-08</SB>
<SC>-5.763168E-13</SC>
</SystemTC>
<Linearity>
<Cor>1.255103E-10</Cor>
<Gain>0.9998779</Gain>
</Linearity>
<Creep>
<CreepA>
<FinV0>6.496906E-05</FinV0>
<FinV1>0</FinV1>
<FinV2>0</FinV2>
<Tau0>0.001777649</Tau0>
<Tau1>0</Tau1>
<Tau2>0</Tau2>
</CreepA>
<CreepB>
<FinV0>4.994869E-05</FinV0>
<FinV1>0</FinV1>
<FinV2>0</FinV2>
<Tau0>0.0001777411</Tau0>
<Tau1>0</Tau1>
<Tau2>0</Tau2>
</CreepB>
<CreepC>
<FinV0>9.953976E-06</FinV0>
<FinV1>0</FinV1>
<FinV2>0</FinV2>
<Tau0>5.924702E-05</Tau0>
<Tau1>0</Tau1>
<Tau2>0</Tau2>
</CreepC>
</Creep>
<Hysteresis>
<Zero>119020</Zero>
<Span>968630</Span>
<GuardBand>200</GuardBand>
<Increasing>
<A_Term>0</A_Term>
<B_Term>0</B_Term>
<C_Term>0</C_Term>
<E_Term>-1.065821E-12</E_Term>
</Increasing>
<Increasing>
<A_Term>8E-05</A_Term>
<B_Term>-8.259087E-11</B_Term>
<C_Term>0</C_Term>
<E_Term>-1.065821E-12</E_Term>
</Increasing>
</Hysteresis>
</XMLSchema_LCData>
Any help?
Kenny O'Dell
Sr. R&D Software Engineer
Mettler-Toledo Inc.
Inman, SC
|
|
|
|
|
Use XmlDocument instead. Better performance for especially short XML files.
Here is an example:
<br />
private void Insert2XML(string strXmlFilePath, string PersonName, int ID, string Notes)<br />
{<br />
XmlDocument doc = new XmlDocument();<br />
doc.Load(strXmlFilePath);<br />
XmlNode root = doc.DocumentElement;<br />
<br />
XmlNode Person = doc.CreateElement("Person");<br />
Person.SetAttribute("Name", PersonName);<br />
Person.SetAttribute("ID", ID.ToString());<br />
Person.InnerText = Notes;<br />
root.AppendChild(Person);<br />
<br />
XmlTextWriter writer = new XmlTextWriter(strXmlFilePath, null);<br />
writer.Formatting = Formatting.Indented;<br />
writer.Indentation = 4;<br />
doc.Save(writer);<br />
writer.Close();<br />
}<br />
<br />
private string GetPersonID(string strXmlFilePath, string PersonName)<br />
{<br />
XmlDocument doc = new XmlDocument();<br />
doc.Load(strXmlFilePath);<br />
XmlNode root = doc.DocumentElement;<br />
<br />
XmlNode SearchNode = root.SelectSingleNode("//*[@Name='" + PersonName + "']");<br />
if (SearchNode != null)<br />
{<br />
return SearchNode.Attributes["ID"].Value;<br />
}<br />
else<br />
{return "Not Found!"}<br />
}<br />
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
The .NET TextBox control automatically provides a nice context menu that pops up when the user right-clicks in it with all the stuff expected, like Cut, Copy and Paste (and some surprising ones, like right-to-left selection, etc.). However, if you add a context menu component of your own you lose the one provided. Does anybody know a way to find and merge with the default menu? I've been trying to add an item to call a spell checker I've added to my project and don't want to have to duplicate all of the nice things the TextBox already provides on its default context menu... Any thoughts?
Thanks in advance for any help!
P.S. I posted this question in the .NET forum, too - I don't want to clutter up these boards with duplicates, but this area looked a bit more active so I thought I'd try here as well...
Mitchell
|
|
|
|
|
|
Thanks for the tip - I sure wish it could be easier, but at least you've given me a place to start!
Mitchell
|
|
|
|
|
I have a ListBox (CatList) and an ArrayList (Cats) bound to it. I'm removing the selected item in the ListBox from the ArrayList and rebinding the source after removing:
<br />
private ArrayList Cats = new ArrayList();
...<br />
...<br />
<br />
private void bRemoveCat_Click(object sender, System.EventArgs e)<br />
{<br />
int selIndex = this.CatList.SelectedIndex;<br />
<br />
this.CatList.DataSource = null;<br />
this.CatList.Items.Clear();<br />
<br />
Cats.RemoveAt(selIndex);<br />
<br />
this.CatList.DataSource = Cats;<br />
this.CatList.DisplayMember = "Name";<br />
this.CatList.ValueMember = "ID";<br />
}<br />
No exception is thrown when the above code is executed but after the code is executed, if I click on the ListBox, the exception below is immediately thrown.
<br />
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll<br />
<br />
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.<br />
What do you think? Thanks in advance.
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
I'd verify the value of selIndex before you try and use it on the Cats arraylist.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I already did it Dave. Actually the item is removed properly. But the error occurs after this process (when I click anywhere on the ListBox)
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
Using ASP.NET with C# I have two login screens for the application. One to get into the system and a second login screen, which is for administrator tasks. The first one redirects me to my default page with the method below. I have duplicated the code from the login page and im using it for my admin login page but do not want it to automatically redirect me to the default screen again. Instead I would like it to direct me to a page called administrator.aspx. how do I do this. Im New to c sharp. Small hurdle huh! Any help much appreciated.
Chris
if (id != null)
{
// Set the user as authenticated and send him to the
// page originally requested.
FormsAuthentication.RedirectFromLoginPage(id, false);
}
|
|
|
|
|
Please direct your ASP.NET-related questions to the ASP.NET forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi, first of all try the ASP.NET forum as it would be more specified.
If my memory is correct, you can use the Response.
well for each aspx page there is HTTP support for REQUEST & RESPONSE.
you can use
this.response.redirect(...) method to redirect to another page.
Sorry, I don't know much asp.net.....but tried to help out anyway!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
Thanks for your advice. will try it out
|
|
|
|
|
hi everybody
is any bod know how to run desktop application from we page...As specially on web page..?
|
|
|
|
|
Try the Web Development[^] forum, although you should keep in mind that you can't coax a browser into starting an application without exploiting a security hole because to do so would be a serious security vulnerability if it were allowed.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi All,
I am relatively new to c# and i am working in .NET 2003. I use very often a MessageBox, but sometimes it comes without a text on it, even if i have assigned a text to it (MessageBox.Show(stringVariable); ). The same happens to ComboBox and ListBox. They appear blank, although they are bound to the corresponding DataSource. Later (when the application is still running) appears the text suddenly. May be does anyone know the problem?
Very gratefull in advance,
Sailer
|
|
|
|
|
Your description offers almost no technical information that is necessary to help you. Please provide snippets of your code, including your data-binding code (just snippets though, please). It's probably that if you're getting data from the underlying data source your not taking the appropriate actions to get the right data. Debugging your application and stepping through your code is what you should do first. In Visual Studio, just open your project, set a breakpoint at the beginning of a method that uses MessageBox where the problem occurs, and hit F5 (Debug->Start Debugging).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Well a messagebox takes at least 2 parameters the caller and message,
Therefore I would suggest you to use it like this:
MessageBox.Show(this,StringVariable);
For the combobox & listbox, I would suggest you to loop through the datasource and insert an item every time! In this case, you can debug and it will be 1000% sure the items will be added!
Regards
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|