|
-
Nov 22nd, 2008, 03:16 AM
#1
Thread Starter
New Member
creating an array from datagridview rows. possible?
im new to programming and i really dont know how arrays work. so i have this code below:
Dim dt As New DataTable
Dim da As New SqlClient.SqlDataAdapter("SELECT FEE_NAME, convert(varchar(50), convert(money, FEE_AMOUNT), 1) FROM FEE_TABLE ", m_Connection)
da.Fill(dt)
DataGridView2.DataSource = dt
now this will show in the datagridview as:
__________________________
FEE_NAME | FEE_AMOUNT |
------------------------------
registration | 8,000.00 |
------------------------------
books | 4,500.00 |
------------------------------
uniform | 7,300.00 |
------------------------------
library | 3,000.00 |
------------------------------
is it possible to put all the rows in fee_name into an array when its already in the datagridview like when i click a button.
so the array will show
array1 = ["registration" , "uniform" , "books" , "library" ]
i have read that i need to use a for each statement like:
For Each row As DataGridViewRow In DataGridView1.Rows
DONT KNOW WHAT TO PUT HERE
Next
because i need to add these rows in a different table in the database or create a view (in ms sql server 05). a sample code will really really help me. thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|