Click here to Skip to main content
15,926,939 members
Home / Discussions / C#
   

C#

 
GeneralDetecting if a doubleclick is on an item or in the empty space of a listbox Pin
Dan Neely1-Jun-05 9:17
Dan Neely1-Jun-05 9:17 
GeneralRe: Detecting if a doubleclick is on an item or in the empty space of a listbox Pin
Robert Rohde1-Jun-05 10:55
Robert Rohde1-Jun-05 10:55 
GeneralRe: Detecting if a doubleclick is on an item or in the empty space of a listbox Pin
Dan Neely3-Jun-05 2:16
Dan Neely3-Jun-05 2:16 
GeneralC# com addin for PowerPoint Pin
JonasSyrstad1-Jun-05 9:11
JonasSyrstad1-Jun-05 9:11 
GeneralStarting the application with windows startup Pin
Mohamed El Gohary1-Jun-05 8:44
Mohamed El Gohary1-Jun-05 8:44 
GeneralRe: Starting the application with windows startup Pin
JonasSyrstad1-Jun-05 9:23
JonasSyrstad1-Jun-05 9:23 
QuestionHow to bold the dates Pin
pakFari1-Jun-05 8:35
pakFari1-Jun-05 8:35 
AnswerRe: How to bold the dates Pin
Robert Rohde1-Jun-05 10:59
Robert Rohde1-Jun-05 10:59 
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 

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.