Click here to Skip to main content
15,913,224 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Designing a multiple row input table Pin
Paul Conrad4-Aug-08 10:44
professionalPaul Conrad4-Aug-08 10:44 
QuestionNew to C# Pin
viciouskinid26-Jul-08 20:09
viciouskinid26-Jul-08 20:09 
AnswerRe: New to C# Pin
Manuel Montoya27-Jul-08 15:14
Manuel Montoya27-Jul-08 15:14 
AnswerRe: New to C# Pin
Luc Pattyn27-Jul-08 15:36
sitebuilderLuc Pattyn27-Jul-08 15:36 
AnswerRe: New to C# Pin
Paul Conrad27-Jul-08 19:39
professionalPaul Conrad27-Jul-08 19:39 
QuestionWhen I minimize the window, memory is freed C#. Pin
mahabir25-Jul-08 19:38
mahabir25-Jul-08 19:38 
AnswerRe: When I minimize the window, memory is freed C#. Pin
mahabir25-Jul-08 19:53
mahabir25-Jul-08 19:53 
QuestionLots of Problems with CheckedListBox.CheckedItems databinding/running stored procs...HELP Pin
noob_bedazzler25-Jul-08 12:20
noob_bedazzler25-Jul-08 12:20 
Hi,

I'm in desperate need of help. I'm very new to C# and have only limited exposure to ASP.NET. I'm developing a win form application.
Basically, the user clicks a button and imports a text file into a sorted checkedlistbox. That works so far.
The text file will hold a list of IDs that need to be retrieved from a table in my DB. I have a stored proc in the db that does the same but when I ran that via GetStoredProcCommand, I'm getting 'Array out of Bounds' exceptions.
I've tried GetStoredProcCommandWithSourceColumns, GetStoredProcCommand, ExecuteReader, and AddInParamter, all of which won't work. I know I'm making it harder than it really is since I'm also using VS2008. If stored procs won't work, I will settle for a regular select * from table where user = CheckedlistBox.CheckedItem as well. Once I have the users I need to work with, I have several stored procs that should be run depending on the what control the user clicks. I just don't why it's not working trying to run a simple proc. Thanks in advance for your help.
I've read, read, and researched every place I could before posting here as well.

Code below

//code to load/process IDs (from import to checkedlistbox) with a stored proc in a sybase table

private void ProcessListbutton1_Click(object sender, EventArgs e)
{

try
{
//open up database connection
Database _db = DatabaseFactory.CreateDatabase();

foreach (object sysuser in CheckedListBox1.CheckedItems)
{

DbCommand cmd = _db.GetStoredProcCommand("sp_ust_user_retrieve");

}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message) ;

}


-----------------------------

//import text file into Checkedlistbox


private void Importbutton1_Click(object sender, EventArgs e)
{
this.checkedListBox1.Items.Clear();
//this.checkedListBox1.GetItemCheckState();
OpenFileDialog Open = new OpenFileDialog();
Open.Filter = "Text Document|*.txt|All Files|*.*";
try
{
Open.ShowDialog();
StreamReader Import = new StreamReader(Convert.ToString(Open.FileName));
while (Import.Peek() >= 0)
checkedListBox1.Items.Add(Convert.ToString(Import.ReadLine()));
}
catch (Exception ex)
{
MessageBox.Show(Convert.ToString(ex.Message));

return;
}
this.checkedListBox1.BeginUpdate();
for (int x = 0; x < 0; x++)
{
this.checkedListBox1.Items.Add(x.ToString());
}
for (int x = 0; x < this.checkedListBox1.Items.Count; x++)
{
this.checkedListBox1.SetItemChecked(x, true);
}
this.checkedListBox1.EndUpdate();





I've tried databinding directly from the checkedlistbox and it returned all rows in the table - and overwrote what I imported. I only need to return rows from that table that are checked.
I hope this was clear. If not, please be patient with me and I will post whatever is needed. Smile | :)
AnswerRe: Lots of Problems with CheckedListBox.CheckedItems databinding/running stored procs...HELP Pin
Mycroft Holmes26-Jul-08 21:43
professionalMycroft Holmes26-Jul-08 21:43 
AnswerRe: Lots of Problems with CheckedListBox.CheckedItems databinding/running stored procs...HELP Pin
noob_bedazzler28-Jul-08 4:54
noob_bedazzler28-Jul-08 4:54 
GeneralRe: Lots of Problems with CheckedListBox.CheckedItems databinding/running stored procs...HELP Pin
Mycroft Holmes28-Jul-08 12:24
professionalMycroft Holmes28-Jul-08 12:24 
GeneralRe: Lots of Problems with CheckedListBox.CheckedItems databinding/running stored procs...HELP Pin
Paul Conrad28-Jul-08 17:57
professionalPaul Conrad28-Jul-08 17:57 
AnswerRe: Lots of Problems with CheckedListBox.CheckedItems databinding/running stored procs...HELP Pin
noob_bedazzler28-Jul-08 4:57
noob_bedazzler28-Jul-08 4:57 
QuestionWebsercies for windows Applications using C#.net Pin
balu1234525-Jul-08 8:03
balu1234525-Jul-08 8:03 
RantRe: Websercies for windows Applications using C#.net Pin
Ashfield25-Jul-08 8:27
Ashfield25-Jul-08 8:27 
QuestionHow to convert word to pdf Pin
Jerry Joseph M.25-Jul-08 3:57
Jerry Joseph M.25-Jul-08 3:57 
AnswerRe: How to convert word to pdf Pin
Paul Conrad27-Jul-08 19:41
professionalPaul Conrad27-Jul-08 19:41 
AnswerRe: How to convert word to pdf Pin
Jerry Joseph M.27-Jul-08 20:01
Jerry Joseph M.27-Jul-08 20:01 
GeneralRe: How to convert word to pdf Pin
Paul Conrad27-Jul-08 20:05
professionalPaul Conrad27-Jul-08 20:05 
QuestionBitMap to AVI Pin
Mohammad Al Hoss24-Jul-08 3:58
Mohammad Al Hoss24-Jul-08 3:58 
AnswerRe: BitMap to AVI Pin
Thomas Stockwell24-Jul-08 5:38
professionalThomas Stockwell24-Jul-08 5:38 
AnswerRe: BitMap to AVI Pin
originSH25-Jul-08 5:48
originSH25-Jul-08 5:48 
QuestionC# for driver level on print spooler Pin
balu1234523-Jul-08 2:09
balu1234523-Jul-08 2:09 
QuestionUser control & custom control Pin
ashwinibhalerao22-Jul-08 19:17
ashwinibhalerao22-Jul-08 19:17 
AnswerRe: User control & custom control Pin
John Ad22-Jul-08 20:48
John Ad22-Jul-08 20:48 

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.