Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search


DataSource Controls :: Save Data Into Sql Database From Gridview

i'm new to programming and i'm doing a project of ana e-store, i have a data gridview that brings data from a data base and it have to more templeate files one a textbox and the other one is a label. and i have a button outside the grivdview.what i need that when i press on this button it will takethe values from the grid view and insert them into a new sql table.


and here is the VB code that i'm trying to use with no luck : [Code]....

View 7 Replies (Posted: Mar 27, 2010 07:49 AM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
Forms Data Controls :: Gridview - Save Grid Contents To Database Only When Save Button Pressed
I wanted to have a gridview control where the columns are not saved to a database until a save button is pressed. But, the grid should be able to

allow the user to add rows, edit rows, and delete rows, but not save any data to the database of course until the button is pressed. So, there needs to be some sort of temporary data structure to bind to (or to save each row to), and then just save the contents of that data structure. Of course, if the user deleted a row, that data structure should keep track of that deleted row's ID for example, then delete those rows that are marked for delete only when the one button (save) is pressed.

I've already got a grid that is bound to a table working just fine, but what would be the easiest way to do this?

Posted: Nov 25, 2009 08:12 PM

View 8 Replies!   View Related
DataSource Controls :: Save Textbox Data In Database?
how can i save text introduced in textboxes to a database in visual studio 2010? Data base is managed with sql management studio 2008..

Posted: Nov 16, 2010 09:29 AM

View 3 Replies!   View Related
DataSource Controls :: Save Outlook Data Into Sql Database?
when i create a contact into outlook.i want to save this contact into sql database...i know i fetch all contact from MAPi contact folder...but i unable to understand how can i differenciate between newly contact n old contact when i save into sql database becoz contact folder return all contacts(new as well as old)....

Posted: Dec 02, 2009 07:56 AM

View 3 Replies!   View Related
DataSource Controls :: Data Type Float / Save The Database 10,00, And Not 10
I have a variable in the database "Amount". Data type is a float, but if I write 10.00, save 10 This is not good.

I want to save the database 10,00, and not 10.

Posted: May 06, 2010 05:39 PM

View 6 Replies!   View Related
DataSource Controls :: How To Retrieve The Data From The Session (Dataset) And Save It Into A Database
How to retrieve the data from the session (Dataset) and save it into a database


Posted: Mar 24, 2010 03:05 PM

View 3 Replies!   View Related
Forms Data Controls :: Get The Value From Textbox Inside The Gridview And Save To Database?
how to get the value from textbox that is inside the gridview and save to database.. this is my code:


Posted: Jan 26, 2011 05:17 AM

View 25 Replies!   View Related
Forms Data Controls :: Write / Save Data From GridView To Table In Database?
I have gridView with checkbox on each row, when user click "Submit" then I want a loop go through the gridview, then save those are checked.

ClientID | Client | Emails |chkBox |


On the code behind, how can Iidentify the data on eachrow to save to database?


Posted: Jun 01, 2010 09:16 PM

View 4 Replies!   View Related
Forms Data Controls :: Save Entire Gridview Data Into Database?
I am developing a projectusing Visual Web Developer 2008 express. I am displaying the excel data set into Grid view, each execl sheet having 400 records, i want savethis whole grid view data into mysql table with single clickToacheive above task shall i need to create a table in mysql database having same excel names.

Posted: Dec 17, 2010 02:48 AM

View 12 Replies!   View Related
DataSource Controls :: Make A Button For Save As Gridview Data Into Mdb Access File?
i have a gridview that show data from sql data source . how i can make a button for save as gridview data into mdb access file !?

Posted: Jul 24, 2010 04:11 AM

View 6 Replies!   View Related
Forms Data Controls :: GridView,calculate Value Based On Other Columns& Save To Datasource?
I had just started withVisual Studio 2008 + I've now designed my tables, and basic gridview functions properly.Now I'm faced with the problem of having to calculate a value based on 2 - 3 columns/data in the gridview, display the result in an existing column in the same gridview, and saving the calculated value in the datasource.I had initially created the "Total" column as a textbox displaying a manually calculated amount that is saved in the datasource. Now, I want to change the field to auto-calculate based on 2 other columns.

Posted: Nov 08, 2010 07:49 AM

View 4 Replies!   View Related
Forms Data Controls :: Image Upload In Gridview - Save Multiple Record Into Database
I have another problem is that I have Placed a file upload control in Empty template of Gridview to have multiple record insert. I have used viewstate to save multiple record into database. But problem is that I am able to find the control but it not giving any value.I have following code.


in above code


Posted: Feb 18, 2010 01:29 PM

View 2 Replies!   View Related
Forms Data Controls :: Gridview - Save Selected Values And Checked Boxes In Database
I have a gridview and users would select some records and would click on the submit button and i will be saving those records into database using a stored proc.... now .... just below the gridview and above the submit button there are few checkboxes by default they wud be checked. How would i save the selected values and the checked boxes in database i wrote the stored proc for the gridview but how would i save the checked checkboxes into the same table.

For i As Integer = 0 To gvSelectScreen.Rows.Count - 1
Dim chkTemp As CheckBox = TryCast(gvSelectScreen.Rows(i).FindControl("cbStatus"), CheckBox)
If chkTemp.Checked Then
ContractNumber = gvSelectScreen.Rows(i).Cells(0).Text
ClientProgramNumber = gvSelectScreen.Rows(i).Cells(1).Text
ClientProgramName = gvSelectScreen.Rows(i).Cells(2).Text
StartDate = CType(gvSelectScreen.Rows(i).FindControl("txtStartDate"), TextBox).Text
EndDate = gvSelectScreen.Rows(i).Cells(5).Text
Dim connStr As String = ConfigurationManager.ConnectionStrings("MainConnectionString").ConnectionString
Dim myCon As New SqlConnection(connStr)
Dim cmd As New SqlCommand("usp_ParametersFromGrid")
Dim dt As New DataTable
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@ContractNumber", SqlDbType.VarChar, 22).Value = ContractNumber.ToString()
cmd.Parameters.Add("@ClientProgramNumber", SqlDbType.VarChar, 22).Value = ClientProgramNumber.ToString()
cmd.Parameters.Add("@ClientProgramName", SqlDbType.VarChar, 100).Value = ClientProgramName.ToString()
cmd.Parameters.Add("@StartDate", SqlDbType.VarChar, 20).Value = StartDate.ToString()
cmd.Parameters.Add("@EndDate", SqlDbType.VarChar, 20).Value = EndDate.ToString()
cmd.Parameters.Add("@RequestID", SqlDbType.VarChar, 50).Value = RequestID.ToString()
cmd.Connection = myCon
End If

Now above the submit button as i said, there are few checkboxes and they are checked by would i save the selected item (in the gridview and the checked checkbox values in the same row in the database(sql server)

Posted: Feb 02, 2010 03:55 PM

View 5 Replies!   View Related
DataSource Controls :: Save File Into The Sql Server Database?
I want to upload a file (e.g. .xls, .pdf, .doc) and save into the Sql Server 2000 database through the web interface, and then to download this file.

Posted: Feb 28, 2008 03:54 PM

View 2 Replies!   View Related
DataSource Controls :: How To Save A File Into Mysql Database
how i can save a file into my mysql database..

i want to save a file into database not the path..

Posted: May 09, 2010 08:15 PM

View 3 Replies!   View Related
DataSource Controls :: C# - Can Save Datatable Back To Database
How can i save the datatble back to my database?

First i selected some rows from database then using adp.Fill(DT) i filled datatable then i closed connection.

Then i made changes in this datatable in some rows & now i wonder how can i send this rows back to database?

NOTE:-i modified my datatble using FOR loop .and i set cells to someother values like dt.rows[2][2]="anything i want";

Posted: Apr 25, 2010 10:09 AM

View 1 Replies!   View Related
DataSource Controls :: Save One Excel File In Sql Database?
i want to save one excel file in sql database in some column and same i want to retrive . for this i am using file upload control to upload a file.

i did follwoing

i defined one column in sql for storing the file with datatype. image

when i am inserting a document in this column "<Binary data>" this value is showing.

and when i trying to retrive this file.In the file "System.Byte[]" text is coming in a cell.

I am storing excel file in database

code to insert a Excel file in database:

Int32 File1Length = this.FileUpload1.PostedFile.ContentLength;
String File1Type = this.FileUpload1.PostedFile.ContentType;
Stream File1Stream;
File1Stream = this.FileUpload1.PostedFile.InputStream;


Posted: Apr 17, 2010 08:40 AM

View 1 Replies!   View Related
DataSource Controls :: CheckBoxList Items Save To Database?
I've this checkboxlist with differentsports items inside (Example Swimming, Floorball, Basketball and etc). Users are able to check/tick more than one item as they may be interested in lots of different sports.However, I realised that I'm not able to save all the items that the user has checked into the database; only an item will be saved. How can I save all the items that the user has checked into the database?The codes I'm implementing now:cblSportsInterest.SelectedValue (to save the value into the database)

Posted: Jan 04, 2010 02:02 PM

View 4 Replies!   View Related
DataSource Controls :: Save Encrypted Password Into Database Table?
I'm using ASP.NET 3.5 and Visual Studio 2008 C#.

I'm creating a website and currently making tests for registration. I've manage to create a registration form in the web site and save what the user inputs in the textboxes into a sql server 2008 database.

One of the fields is Password. What I want know is how do you save the password into the database but the database stores it encrypted. That way I'm just able to see the password encrypted. Then when I make a log-in form how to validate the password input by the user with the encrypted one and give a succesful login.

Posted: Jun 14, 2010 08:42 PM

View 4 Replies!   View Related
DataSource Controls :: Save Uploaded File Path In Database
how can we save the uploaded file path in to database and thenretrieve it ingridview as a linkso when user click on that it will openthat file in browser.

Posted: Apr 26, 2010 10:03 AM

View 8 Replies!   View Related
DataSource Controls :: Update Query To Edit Records And Save To Database?
I am doing update query to edit my records and save to my database...I am getting the query expression exception...syntax error (missing operator) in query expression 'WebLogin=krish'.

string strUserName = Request.QueryString["UserName"].ToString();
DateTime dateTimeNow = DateTime.Now;
string ConnString = ConfigurationManager.ConnectionStrings["Data"].ConnectionString;[code]....
I am getting the exception syntax error (missing operator) in query expression 'WebLogin=krish'.

Posted: Feb 22, 2010 04:51 PM

View 3 Replies!   View Related
DataSource Controls :: Editing Data From A Gridview To A Database
As the subject says, i display a gridview filtered from 3 dropdownlist, wich all the items are from a local Data base, once i display this gridview i want to select a row with a button then and add, modify or delete data from it and then this new info is saved on the data base, so when i display the grid again i will see the new info. Im working on visual studio 2010, i dont use code behind, all is in asp .net.


Posted: Feb 07, 2011 02:17 PM

View 1 Replies!   View Related
DataSource Controls :: Save An Edit In A Gridview?
I get this while trying to save an edit in a Gridview. I removed the @albumUID whivh it automaticlly gerneated when a new record is enteredinto the database. BanUID is the only other uniqueidentifier but in this table it is not set to auto generate,I get the same response if I make a Detialviews and unsert.Here's the code

<asp:SqlDataSource ID="SqlDSAddAlbum" runat="server"
ConnectionString="<%&#36; ConnectionStrings:MyCDsConnectionStringHome %>"
DeleteCommand="DELETE FROM [Album] WHERE [AlbumUID] = @AlbumUID"


Posted: May 01, 2010 02:03 AM

View 1 Replies!   View Related
DataSource Controls :: Save Values In GridView With 2 Tables
I have a form with several DropDownlistsand TextBoxes, Each dropdownlist depends on the selection of the previouse one.. and there is a submit button. Once the user clicks on it, information entered by the user is displayed in a GridView and saved as well in the database. TheGridViewholdes information from two tables I used joining) , but once I click on the Submit button I receive this error: Arithmetic overflow error converting varchar to data type numeric. The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Arithmetic overflow error converting varchar to data type numeric. The statement has been terminated. Source Error:


Imports System.Data.SqlClient
Imports System.Web.Configuration
Class Members_MembersCalculator
Inherits System.Web.UI.Page
Protected Sub CalculateButton_Click(ByVal sender
As Object,
ByVal e As System.EventArgs)
Handles CalculateButton.Click
Dim objConnection As SqlConnection
Dim objDataCommand As SqlCommand
Dim c_manu, c_model, c_date
As String
Dim sSQL As
Dim ConnectionString As
Dim c_factor As
Dim c_result
As Double
Dim c_milage As
Dim c_id As
Dim c_year As
c_manu = ManDropDownList.Text
c_year = YearDropDownList.Text
c_model = ModelDropDownList.Text
c_milage = MilageTextBox.Text
c_factor = FactorDropDownList.Text
c_id = CarIDDropDownList.Text
c_date = CarDateTextBox.Text
c_result = c_factor * c_milage
ConnectionString = WebConfigurationManager.ConnectionStrings("Carbon_free_ConnectionString").ConnectionString
objConnection = New SqlConnection(ConnectionString)
sSQL = "Insert into car (Manufacture, year, Model, car_factor)" & _
"values('" & c_manu &
" ', ' " & c_year & " ',' " & c_model &
" ', ' " & c_factor &
" ')"
objDataCommand = New SqlCommand(sSQL, objConnection)
objConnection = New SqlConnection(ConnectionString)
sSQL = "Insert into car_Result (car_id, car_Result_Date, Car_result)" & _
"values('" & c_id &
" ', ' " & c_date & " ',' " & c_result &
" ')"
objDataCommand = New SqlCommand(sSQL, objConnection)
msgLabel.Text = "Your records have been calculated successfuly, Thank you."
'CarDateTextBox.Text = ""
'MilageTextBox.Text = ""
End Sub

Posted: May 29, 2010 09:37 AM

View 3 Replies!   View Related
DataSource Controls :: Searching TextBox Data In Sql Database And Binding The Result In Gridview
I have few textboxes and I want to search the text (partial search is also required) in the database and then show the result in a telerik grid. The grid has to be hidden initially and when I click the search button it should show up and display the results.

Posted: Oct 28, 2010 03:45 AM

View 2 Replies!   View Related
Forms Data Controls :: View Image From Database In A Gridview Using Object Datasource?
I want to display images, which i stored in the MSSQL 2008 with the type of varbinary, in a gridview.

I am using N-Tier to support my web application, i can get the image's value which is in binary type, but i do not know how to display it via a gridview.

Posted: May 20, 2010 09:38 AM

View 3 Replies!   View Related
DataSource Controls :: Unable To Save The Data?
I'm currently doing a program to storesome data like a Login/ Registration page. Datas include username, age, password etc.I created a save button to save the datas into the accdataset.Now whenI start debugging, and i type in the information requires (Name,password etc..), and i click on the save button,the information i wrote will be shown in the acctabledatagrid,<- It have been working correctly till now.However, whenever when i stop debugging and edit the program, the datas will be clear and there will be no information shown on the acctabledatagrid.So I'm quite stuck here as I am unsure where my problem lies.

Imports System.Data
Imports System.Data.SqlClient
Public Class Form1


Posted: Jan 11, 2010 04:36 AM

View 6 Replies!   View Related
Web Forms :: Add Controls At Runtime And Save Data To Database
What i am trying to do is to add controls, say a textbox, at runtime. Which i can do with javascript. But i my main problem is i am not able to get how to store data entered in that texbox by user to database.

Posted: Oct 29, 2009 06:36 AM

View 5 Replies!   View Related
Forms Data Controls :: Save Datagrid Value Into A Database?
I wanna write values in my datagrid into a database.


This works fine with the first produkt. What my problem is that I want write ALL the produkts in the datagrid not just the first one.

Posted: Jan 16, 2010 10:53 PM

View 7 Replies!   View Related
Forms Data Controls :: Save Data From Detailsview Control To Database?
i want to insert data from details view to database.i took a detailsview control and some textboxes, and one button. then how can i save the data to code is below.

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
DataKeyNames="ProductID" AllowPaging="False" Width="500"


Posted: Nov 10, 2010 09:03 AM

View 1 Replies!   View Related
Forms Data Controls :: Save Datagrid Values To SQL Database C#
Ihave a webformwith fieldssuch ascustomerID, address, email, etc. and it also include fields to look up a product, price, extended price, etc. When looking up a product I have the option to add the values to a datagrid to basically build a quote which includes a line for each product, price, etc. that was looked up and then added to the datagrid.

I have written a stored procedure that will do an Insert or update, and I am not having a problem getting the values of the visible fields (customerID, address, etc.). However, I am not sure how I can get the values that appear in the datagrid to write to the SQL table. This is kind of hard to explain, but basically I am trying to figure out a way to write the lines of the datagrid to the database.

Posted: Oct 22, 2009 01:14 PM

View 5 Replies!   View Related
Forms Data Controls :: Save Images To Database Or To Server
I have been debating back and forth between using a database or the file server to store images for users. Finally when I decided to use the file server I found it difficult. What I am trying to do is give a user the option to save multiple profile pictures. I have looked all over for tutorials on how to save to the file server but could find nothing related. Essentially what I would like to do is create folders for each user and their images. I am having no luck. Does anyone have example code or links to what I am looking for?

Posted: Jun 14, 2010 02:34 AM

View 3 Replies!   View Related
DataSource Controls :: Update The Data Of A Database Through A Gridview Update Button?
iwant to update the data ofa database through a gridview updatebutton

how can i attacha dataconvertionlike this


Posted: Apr 19, 2010 05:19 AM

View 1 Replies!   View Related
Forms Data Controls :: How To Save A Doc File's Text To Database Table
actually my need is that, after uploading a doc file I want to save this doc file's text to database table, with the help of asp fileupload control. actually in real I dont want to save this whole file anywhere, but I just need the text to save in databse.

Posted: Mar 17, 2011 11:19 AM

View 2 Replies!   View Related
Forms Data Controls :: Formview: How To Pick A Filename And Save It To Database
In my application I have a formview, used for inserting/editing records in a product details table.

My problem is now, that one of the fields is used for the filename of a productimage, uploaded to a folder on the server from another page.

When inserting - or editing - a record, it should be possible somehow to get list of the files in the productimages folder, select one, and then store the filename (no path needed) in the database. basically I need some kind of 'file-picker' to select the filename and put it into a textbox. It could be anything from a dropdownlist to something more sofisticated - as long as I can include it in my formview.

Posted: Dec 13, 2010 06:19 PM

View 6 Replies!   View Related
Forms Data Controls :: How To Upload Images In To A Folder In Project And Save The URL In The Database
I want to upload images in to a folder in my project and save the URL in the database.

When you add a record into my database you provide title, date added and some other details and there it a file upload control which you browser to a image and it saves the image to a folder in my project, it all works, the record is added and the image is uploaded into the folder, but the problem I have is that there is no link from the record to the image, there is no URL path saved in the record. How do I save the image in the folder and save the URL of the image to the record?

I'm using details view to insert the records and using grid view to view the records.

Posted: Jul 31, 2010 01:08 PM

View 10 Replies!   View Related
DataSource Controls :: Can't DDS Package That's Have Been Save From SQL Server Data Import/Export Wizard
I have to export some data from excel to sql server. So, I just used simply Import/Export wizard from Management Studio.

Fill up and set the all necessary according to this wizard, after that I saved as SSIS Package.

Because, I have to run this package several time, but unfortunately, I can't find it where she saved it.

That may be funny, but really i can't find it out So, How to i save this package?

Posted: Feb 23, 2010 05:09 AM

View 2 Replies!   View Related
DataSource Controls :: Export Data Of Sqldatasource To Exel And Save It In Specific Location?
I have a code that read all data from sqldatasource and store it in exel file. my problem is,when the program run when i click on button,the message pop up to open or save, so by click on open or save we can either save it in exel file or open and look in exel file.

i want withought poping any message,it store the file directly to the specific folder without infomring the user.

here is my code

string attachment = "attachment; filename=Contacts.xls";

Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);

Posted: Mar 10, 2010 08:40 AM

View 4 Replies!   View Related
Forms Data Controls :: Export Database Quary To Excel Sheet With Save As Dialog?
I have page with a link button.. on click of link button I want to save my quary result into excel file with save as dilog box..(like download dilog box in mozila)

Posted: Feb 22, 2010 08:14 AM

View 4 Replies!   View Related
ADO.NET :: Save Temporary Values In Gridview To Database
I have a code here,where it will store temporary data in a gridview from textbox where when the data is stored temporarily in gridview. Alternately,it will be linked to search the word in google. Now i want to save the values in the gridview to database. I m new to,seeking ideas from all. Here is my .aspx code:


And this is my .cs code:


Posted: Sep 17, 2010 03:49 AM

View 8 Replies!   View Related
Copyright 2005-08, All rights reserved