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

Managed C++/CLI

 
AnswerRe: multiple dimensional vector array Pin
Christian Graus4-Dec-06 9:45
protectorChristian Graus4-Dec-06 9:45 
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 
Hi,
Yeah kindly find the list of errors below which are fired when i use this piece of code.

This is my code :
private: System::Void Form1_Load(System::Object * sender, System::EventArgs e)
{
System::String * SqlStr;
ListView * listView1 = new ListView();
try
{
SqlStr = "Select IC, Part_Code, PART_NUMBER, PART_NAME from vdcsssp_PARTS_mst" ;

SqlCommand* objCmd = new SqlCommand();
SqlDataAdapter* objDA = new SqlDataAdapter();
DataSet* objDS = new DataSet();
SqlConnection* objCon = new SqlConnection();
objCon->ConnectionString = "User ID=sa;pwd=qil2004;Data Source=qipl-server;Initial Catalog=Qvdcsssp";
if(objCon->get_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
listView1->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
listView1->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);
}
-----------------------------------------------------------------------------
This is my errors:
e:\Sandeep\VC++ .Net\Test1\Form1.h(376) : error C2061: syntax error : identifier 'each'
e:\Sandeep\VC++ .Net\Test1\Form1.h(377) : error C2143: syntax error : missing ';' before '{'
e:\Sandeep\VC++ .Net\Test1\Form1.h(379) : error C2065: 'gcnew' : undeclared identifier
e:\Sandeep\VC++ .Net\Test1\Form1.h(379) : error C2146: syntax error : missing ';' before identifier 'ListViewItem'
e:\Sandeep\VC++ .Net\Test1\Form1.h(379) : error C2065: 'r' : undeclared identifier
e:\Sandeep\VC++ .Net\Test1\Form1.h(379) : error C2227: left of '->ToString' must point to class/struct/union
e:\Sandeep\VC++ .Net\Test1\Form1.h(381) : error C3861: 'gcnew': identifier not found, even with argument-dependent lookup
e:\Sandeep\VC++ .Net\Test1\Form1.h(381) : error C2143: syntax error : missing ';' before 'System::Windows::Forms::ListViewItem::ListViewSubItem'
e:\Sandeep\VC++ .Net\Test1\Form1.h(381) : error C2227: left of '->ToString' must point to class/struct/union
e:\Sandeep\VC++ .Net\Test1\Form1.h(381) : error C3861: 'r': identifier not found, even with argument-dependent lookup
e:\Sandeep\VC++ .Net\Test1\Form1.h(383) : error C2039: 'SubItems' : is not a member of 'System::Windows::Forms::ListView'
stdafx.cpp(0) : see declaration of 'System::Windows::Forms::ListView'
e:\Sandeep\VC++ .Net\Test1\Form1.h(383) : error C2227: left of '->Add' must point to class/struct/union
e:\Sandeep\VC++ .Net\Test1\Form1.h(385) : error C2143: syntax error : missing ';' before 'System::Windows::Forms::ListViewItem::ListViewSubItem'
e:\Sandeep\VC++ .Net\Test1\Form1.h(385) : error C3861: 'gcnew': identifier not found, even with argument-dependent lookup
e:\Sandeep\VC++ .Net\Test1\Form1.h(385) : error C2227: left of '->ToString' must point to class/struct/union
e:\Sandeep\VC++ .Net\Test1\Form1.h(385) : error C3861: 'r': identifier not found, even with argument-dependent lookup
e:\Sandeep\VC++ .Net\Test1\Form1.h(387) : error C2039: 'SubItems' : is not a member of 'System::Windows::Forms::ListView'
stdafx.cpp(0) : see declaration of 'System::Windows::Forms::ListView'
e:\Sandeep\VC++ .Net\Test1\Form1.h(387) : error C2227: left of '->Add' must point to class/struct/union


Kind Regards
Sandy

GeneralRe: Fill the ListView using DataSet Pin
teejayem11-Dec-06 6:37
teejayem11-Dec-06 6:37 
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 

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.