Click here to Skip to main content
15,911,132 members
Home / Discussions / C#
   

C#

 
GeneralSchema and OdbcConnection Pin
PaleyX1-Jun-05 7:57
PaleyX1-Jun-05 7:57 
GeneralRe: Schema and OdbcConnection Pin
PaleyX1-Jun-05 11:56
PaleyX1-Jun-05 11:56 
GeneralBasic Question : Opening a new windows form and populating data from parent datagrid Pin
Anonymous1-Jun-05 7:43
Anonymous1-Jun-05 7:43 
GeneralRe: Basic Question : Opening a new windows form and populating data from parent datagrid Pin
nemopeti1-Jun-05 9:08
nemopeti1-Jun-05 9:08 
GeneralRe: Basic Question : Opening a new windows form and populating data from parent datagrid Pin
Susan Hernandez3-Jun-05 14:51
Susan Hernandez3-Jun-05 14:51 
GeneralEnding a Worker Thread Pin
goldoche1-Jun-05 6:03
goldoche1-Jun-05 6:03 
GeneralRe: Ending a Worker Thread Pin
S. Senthil Kumar1-Jun-05 7:14
S. Senthil Kumar1-Jun-05 7:14 
Generalpopulating a listview control in another from Pin
Hadi Riazi1-Jun-05 6:03
Hadi Riazi1-Jun-05 6:03 
Hi;
This is what I'm trying to do:
I want to populate a listview on another from and then after quitting this form I could see the changes Ive made.

so I wrote a method to do that for me:

<br />
public void populateListView(ref ListView lview, string dbFilePath, string tableName)<br />
			{<br />
				Connection myConnection = new Connection();<br />
				myConnection.ConnectionString = dbFilePath;<br />
				myConnection.Open();<br />
			<br />
				Recordset rs1 =myConnection.Execute("select * from " + tableName);<br />
<br />
				rs1.MoveFirst();<br />
				for (int i=0; i<rs1.Count; i++)<br />
				{<br />
					ListViewItem lv=new ListViewItem();<br />
					ListViewItem.ListViewSubItem lvs = new ListViewItem.ListViewSubItem();<br />
				<br />
					for (int j=0;j<rs1.Fields.Count;j++)<br />
					{<br />
						if (j==0)<br />
						{<br />
							lv.Text=rs1.Fields[0].ToString();<br />
							lv = lview.Items.Add(lv);<br />
						}<br />
						else<br />
						{<br />
							lv.SubItems.Add(rs1.Fields[j].ToString());<br />
						}<br />
					}<br />
				<br />
					rs1.MoveNext();<br />
				}<br />
<br />
				rs1.Close();<br />
<br />
				myConnection.Close();<br />
<br />
				foreach( System.Windows.Forms.ColumnHeader c in lview.Columns)<br />
				{<br />
					c.Width = -2; <br />
				}<br />
			}<br />


as you see im populating a listview from a database.

I get an error saying marshal_reference . . .

do you guys have any idea?
P.S I did search the codeproject but the solutions were a little complex.

Thanks
GeneralEquivalenet Tell me equivalenet space function in C#.net Pin
ksanju10001-Jun-05 5:19
ksanju10001-Jun-05 5:19 
GeneralRe: Equivalenet Tell me equivalenet space function in C#.net Pin
S. Senthil Kumar1-Jun-05 7:20
S. Senthil Kumar1-Jun-05 7:20 
GeneralRe: Equivalenet Tell me equivalenet space function in C#.net Pin
Dave Doknjas1-Jun-05 14:23
Dave Doknjas1-Jun-05 14:23 
GeneralBubble Sort Pin
Da`Sooty1-Jun-05 4:41
Da`Sooty1-Jun-05 4:41 
GeneralRe: Bubble Sort Pin
Marc Clifton1-Jun-05 5:05
mvaMarc Clifton1-Jun-05 5:05 
GeneralRe: Bubble Sort Pin
DavidNohejl1-Jun-05 8:17
DavidNohejl1-Jun-05 8:17 
GeneralCreating a WebForm to interact with Word Pin
samoore1-Jun-05 4:23
samoore1-Jun-05 4:23 
GeneralRe: Creating a WebForm to interact with Word Pin
Rhys Gravell1-Jun-05 6:06
professionalRhys Gravell1-Jun-05 6:06 
GeneralRe: Creating a WebForm to interact with Word Pin
moose12316-Jun-05 6:29
moose12316-Jun-05 6:29 
GeneralCompiler Warning CS1595 Pin
Nigel Savidge1-Jun-05 4:17
Nigel Savidge1-Jun-05 4:17 
GeneralRe: Compiler Warning CS1595 Pin
Colin Angus Mackay1-Jun-05 4:20
Colin Angus Mackay1-Jun-05 4:20 
GeneralRe: Compiler Warning CS1595 Pin
Nigel Savidge1-Jun-05 4:26
Nigel Savidge1-Jun-05 4:26 
GeneralComboBox DataSource property Pin
JawsSaint1-Jun-05 4:09
JawsSaint1-Jun-05 4:09 
Generaloverride a WN_NCACTIVATE Pin
Anonymous1-Jun-05 4:08
Anonymous1-Jun-05 4:08 
GeneralRe: override a WN_NCACTIVATE Pin
Dave Kreskowiak1-Jun-05 7:37
mveDave Kreskowiak1-Jun-05 7:37 
GeneralRe: override a WN_NCACTIVATE Pin
Sasuko1-Jun-05 12:29
Sasuko1-Jun-05 12:29 
GeneralRe: override a WN_NCACTIVATE Pin
Dave Kreskowiak2-Jun-05 2:55
mveDave Kreskowiak2-Jun-05 2:55 

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.