Click here to Skip to main content
15,902,299 members
Home / Discussions / C#
   

C#

 
GeneralRe: windows service error Pin
Ashfield18-Nov-09 1:19
Ashfield18-Nov-09 1:19 
GeneralRe: windows service error Pin
NarendraSinghJTV18-Nov-09 1:41
NarendraSinghJTV18-Nov-09 1:41 
AnswerRe: windows service error Pin
Abhijit Jana17-Nov-09 23:01
professionalAbhijit Jana17-Nov-09 23:01 
GeneralRe: windows service error Pin
NarendraSinghJTV17-Nov-09 23:20
NarendraSinghJTV17-Nov-09 23:20 
QuestionSequence of Events. Pin
Pavan Navali17-Nov-09 17:28
Pavan Navali17-Nov-09 17:28 
AnswerRe: Sequence of Events. Pin
Giorgi Dalakishvili17-Nov-09 18:54
mentorGiorgi Dalakishvili17-Nov-09 18:54 
AnswerRe: Sequence of Events. Pin
Shameel17-Nov-09 21:49
professionalShameel17-Nov-09 21:49 
QuestionListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Jacob Dixon17-Nov-09 15:51
Jacob Dixon17-Nov-09 15:51 
I cannot figure this out! It is driving me nuts!

Ok so I can do a IndexOfKey and get the index (which in my case is 24), but when I try to get the text it gives an error:

int index = 0;
index = lstImport.Columns.IndexOfKey("Category");

MessageBox.Show(index.ToString()); // THIS SHOWS 24

if (index == -1) cmd.Parameters.AddWithValue("@Category", "");
else cmd.Parameters.AddWithValue("@Category", lstImport.Items[i].SubItems[index].Text); // THIS ERRORS


ERROR:
System.ArgumentOutOfRangeException was unhandled
  Message="InvalidArgument=Value of '24' is not valid for 'index'.\r\nParameter name: index"
  Source="System.Windows.Forms"
  ParamName="index"
  StackTrace:
       at System.Windows.Forms.ListViewItem.ListViewSubItemCollection.get_Item(Int32 index)
       at Grant_Inventory_Import.frmMain.ImportData() in C:\Users\jdixon\Documents\Visual Studio 2008\Projects\Grant Inventory Import\Grant Inventory Import\frmMain.cs:line 560
       at Grant_Inventory_Import.frmMain.btnImport_Click(Object sender, EventArgs e) in C:\Users\jdixon\Documents\Visual Studio 2008\Projects\Grant Inventory Import\Grant Inventory Import\frmMain.cs:line 221
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Grant_Inventory_Import.Program.Main() in C:\Users\jdixon\Documents\Visual Studio 2008\Projects\Grant Inventory Import\Grant Inventory Import\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

AnswerRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Christian Graus17-Nov-09 15:54
protectorChristian Graus17-Nov-09 15:54 
GeneralRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Jacob Dixon17-Nov-09 15:56
Jacob Dixon17-Nov-09 15:56 
GeneralRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Jacob Dixon17-Nov-09 15:59
Jacob Dixon17-Nov-09 15:59 
GeneralRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Jacob Dixon17-Nov-09 17:09
Jacob Dixon17-Nov-09 17:09 
GeneralRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Mycroft Holmes17-Nov-09 20:24
professionalMycroft Holmes17-Nov-09 20:24 
AnswerRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Jacob Dixon18-Nov-09 1:31
Jacob Dixon18-Nov-09 1:31 
AnswerRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Shameel17-Nov-09 21:54
professionalShameel17-Nov-09 21:54 
GeneralRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Jacob Dixon18-Nov-09 1:32
Jacob Dixon18-Nov-09 1:32 
GeneralRe: ListView subitems problem... finds column but throws error.. DRIVING ME NUTS! Pin
Shameel18-Nov-09 6:52
professionalShameel18-Nov-09 6:52 
QuestionHow to make Video Conference in C# Pin
tredsiam17-Nov-09 15:34
tredsiam17-Nov-09 15:34 
AnswerRe: How to make Video Conference in C# Pin
codprojectmajid27-Mar-13 22:10
codprojectmajid27-Mar-13 22:10 
Questiondisabling a GUI form Pin
Shameer E.A.17-Nov-09 10:43
Shameer E.A.17-Nov-09 10:43 
AnswerRe: disabling a GUI form Pin
Ian Shlasko17-Nov-09 10:47
Ian Shlasko17-Nov-09 10:47 
GeneralRe: disabling a GUI form Pin
Shameel17-Nov-09 22:46
professionalShameel17-Nov-09 22:46 
AnswerRe: disabling a GUI form Pin
PIEBALDconsult17-Nov-09 14:17
mvePIEBALDconsult17-Nov-09 14:17 
AnswerRe: disabling a GUI form Pin
_Maxxx_17-Nov-09 15:42
professional_Maxxx_17-Nov-09 15:42 
AnswerRe: disabling a GUI form Pin
Shameel17-Nov-09 22:46
professionalShameel17-Nov-09 22:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.