Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Insert DataGridview into database

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 24-09-2009
Member
 
Join Date: Feb 2009
Posts: 62
Insert DataGridview into database
  

I have made a search function that uses my DataGridView1 to choose what to show in DataGridView2. I have made a search function that uses my DataGridView1 to choose what to show in DataGridView2. If I click on a parameter in the INPUT_LIMITS column in DataGridView1 and then click button2 DataGridView2 is filled with data from the INPUT_LIMITS table that have GroupID with the same value as the parameter I clicked on. I'm not sure how to "cycle" through all my DataGrid rows and collect the cell values, store in variables and then store in a DataTable in VB or directly to SQL database table for insert of all rows and values from my DataGrid.

Reply With Quote
  #2  
Old 24-09-2009
Member
 
Join Date: Feb 2006
Posts: 214
Re: Insert DataGridview into database

Office automation is always a tricky business, especially when you wish to take data from Excel and place it into a relational database. Fill the information in the controls in the footer and then click on save button in the footer and bind grid again on click of save button. Not knowing the specifics, I would recommend you look at several things. dgTargeted.DataSource = dsCLISalesBudget.Tables("tblSalesBudgetTarget") do some(CRUD) stuff in your grid. then make your database table look,have,only contain whats inside your grid daCLISalesBudget.Update(dsCLISalesBudget, "tblSalesBudgetTarget")
Reply With Quote
  #3  
Old 24-09-2009
Member
 
Join Date: Nov 2008
Posts: 43
Re: Insert DataGridview into database

First, Excel interprets data as numeric or string according to its own rules, and will often reveal numeric data as formatted, you you may be better off first placing the information into character fields in SQL Server (in a loading table) then converting to the correct data type there. You can communicate with the database by either a tableAdapter or by using by typing all commands (create a connection, create a command, execute command).
Reply With Quote
  #4  
Old 24-09-2009
Member
 
Join Date: Feb 2006
Posts: 90
Re: Insert DataGridview into database

The most common way of inserting values is by the use of string concatenation. I am able to insert the controls dynamically like text box,combo and checkbutton but i am enable to view the controls. controls r visible when i am click the mouse at that particular grid cell. I am putting some source code line We will concatenate all the values into sql string command and when the concatenation is complete we will have a long string representing all the insertions which can later be send to the command object to be executed.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Insert DataGridview into database"
Thread Thread Starter Forum Replies Last Post
insert into select statement for database Aidan 12 Software Development 5 09-03-2010 09:08 PM
Unable to update my database using insert command Govardhann Software Development 5 13-02-2010 10:10 AM
Is it possible to insert value of TextBox into Sql database using C sharp? Sarfaraj Khan Software Development 5 05-01-2010 10:58 AM
How to update Database with Changes made to the DataGridView afidelino Software Development 3 25-09-2009 08:41 AM
Insert image in access database from vb 6.0 Vireshh Software Development 2 22-01-2009 08:06 PM


All times are GMT +5.5. The time now is 04:20 PM.