Click here to Skip to main content
15,902,492 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: multiple dimensional vector array Pin
George L. Jackson4-Dec-06 10:37
George L. Jackson4-Dec-06 10:37 
GeneralRe: multiple dimensional vector array Pin
Christian Graus4-Dec-06 10:46
protectorChristian Graus4-Dec-06 10:46 
QuestionFill the ListView using DataSet Pin
ksandy454-Dec-06 2:32
ksandy454-Dec-06 2:32 
AnswerRe: Fill the ListView using DataSet Pin
teejayem10-Dec-06 10:48
teejayem10-Dec-06 10:48 
GeneralRe: Fill the ListView using DataSet Pin
ksandy4510-Dec-06 22:09
ksandy4510-Dec-06 22:09 
GeneralRe: Fill the ListView using DataSet Pin
teejayem10-Dec-06 22:13
teejayem10-Dec-06 22:13 
GeneralRe: Fill the ListView using DataSet Pin
ksandy4511-Dec-06 1:08
ksandy4511-Dec-06 1:08 
GeneralRe: Fill the ListView using DataSet Pin
teejayem11-Dec-06 6:37
teejayem11-Dec-06 6:37 
I think (don't quote me on it) the problem was that you were trying to create a control using a pointer (*) and that is why alot of the error's came up. The snippet below compiled fine for me give it a try and let me know how it works for you. If you have anymore problems you can also email me djcarter2326@aim.com. I'm more used to using C# but i am teaching myself Managed C++.
System::String ^ SqlStr;
ListView ^ listView1 = gcnew ListView();
try
{
    SqlStr = "Select IC, Part_Code, PART_NUMBER, PART_NAME from vdcsssp_PARTS_mst" ;

    SqlCommand^ objCmd = gcnew SqlCommand();
    SqlDataAdapter^ objDA = gcnew SqlDataAdapter();
    DataSet^ objDS = gcnew DataSet();
    SqlConnection^ objCon = gcnew SqlConnection();
    objCon->ConnectionString = "User ID=sa;pwd=qil2004;Data Source=qipl-server;Initial Catalog=Qvdcsssp";
    if(objCon->ConnectionString != "")
    {
        objCon->Open();
        objCmd->CommandText = SqlStr;
        objCmd->Connection = objCon;
        objDA->SelectCommand = objCmd;
        objDA->Fill(objDS);
    }
    else
        MessageBox::Show("Error connection Failed");
    return;

    for each (DataRow^ r in objDS->Tables[0]->Rows)
    {
        //Create a listView Item and add the first column of the dataset to it
        ListViewItem^ lvindex = gcnew ListViewItem(r[0]->ToString());
        //Create a subitem and add the seconed column to it
        ListViewItem::ListViewSubItem^ sublvindex = gcnew ListViewItem::ListViewSubItem(lvindex,r[1]->ToString());
        //Add the 1st subitem to the listview item
        lvindex->SubItems->Add(sublvindex);
        //Create the seconed ListView SubItem and add the third column of the Dataset to it.
        sublvindex = gcnew ListViewItem::ListViewSubItem(lvindex,r[2]->ToString());
        //Add the 2nd subitem to the listview item
        lvindex->SubItems->Add(sublvindex);
        //Add the entire ListViewItem to the next available row in myListView
        listView1->Items->Add(lvindex);
    }
}
catch(Exception^ ex)
{
        MessageBox::Show(ex->Message);
}




Don't be overcome by evil, but overcome evil with good

GeneralRe: Fill the ListView using DataSet Pin
ksandy4511-Dec-06 17:47
ksandy4511-Dec-06 17:47 
QuestionHow can i know WDFDEVICE of a device Pin
cshivaprasad4-Dec-06 0:43
cshivaprasad4-Dec-06 0:43 
Questionexport functions [modified] Pin
thathvamsi3-Dec-06 20:27
thathvamsi3-Dec-06 20:27 
AnswerRe: pleae give me the programme code of array struct!! Pin
George L. Jackson3-Dec-06 4:01
George L. Jackson3-Dec-06 4:01 
GeneralRe: pleae give me the programme code of array struct!! Pin
Christian Graus3-Dec-06 12:39
protectorChristian Graus3-Dec-06 12:39 
GeneralRe: pleae give me the programme code of array struct!! Pin
Christian Graus3-Dec-06 17:41
protectorChristian Graus3-Dec-06 17:41 
GeneralRe: pleae give me the programme code of array struct!! Pin
George L. Jackson3-Dec-06 23:20
George L. Jackson3-Dec-06 23:20 
AnswerRe: pleae give me the programme code of array struct!! Pin
Christian Graus2-Dec-06 23:22
protectorChristian Graus2-Dec-06 23:22 
GeneralRe: okey!!!thank you Pin
Christian Graus3-Dec-06 15:57
protectorChristian Graus3-Dec-06 15:57 
GeneralRe: sir Pin
Christian Graus3-Dec-06 16:42
protectorChristian Graus3-Dec-06 16:42 
QuestionHex addition with VC++ in WinXP Pin
pkyiu2-Dec-06 4:38
pkyiu2-Dec-06 4:38 
AnswerRe: Hex addition with VC++ in WinXP [modified] Pin
George L. Jackson2-Dec-06 5:49
George L. Jackson2-Dec-06 5:49 
GeneralRe: Hex addition with VC++ in WinXP [modified] Pin
pkyiu2-Dec-06 7:21
pkyiu2-Dec-06 7:21 
QuestionUSB Pin
cshivaprasad1-Dec-06 0:41
cshivaprasad1-Dec-06 0:41 
AnswerRe: USB Pin
led mike1-Dec-06 5:56
led mike1-Dec-06 5:56 
QuestionForum name Pin
uusheikh30-Nov-06 20:09
uusheikh30-Nov-06 20:09 
AnswerRe: Forum name Pin
Bartosz Bien30-Nov-06 21:11
Bartosz Bien30-Nov-06 21:11 

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.