Insert data in SQL Server database from excel using HTTP Post

Possible Duplicate:
Insert data in SQL Server database from excel using HTTP Post

How can I insert data in SQL Server database from Excel using an HTTP Post to a C# ASP.NET project?

Lets say the URL is: http://testingHttpPost/ and I want to insert data from Cells A2 and B2 into "StudentTable" in Columns "StudentId" and "StudentAge" respectively when I click "Insert" Button in Excel.

I have an ActionResult method "InsertStudent" in Student Controller.

--------------Solutions-------------

You can run c# code from a button in this link: http://blogs.msdn.com/b/vsod/archive/2009/10/02/excel-how-to-run-c-code-behind-with-a-click-of-a-button-on-a-worksheet-without-vba-code.aspx

In your c# code you can read values from the excel sheet and call the web service

Category:c# Time:2011-06-14 Views:2

Related post

  • How to insert data on SQL Server Database in VB.NET? 2011-11-09

    has anyone know how to insert some data on SQL Server database?? i've tried this code, but it not works for me.. here's the code: Dim constring As String = "Data source=.\sqlexpress;attachDbFilename=|DataDirectory|\Database1.mdf;integrated security=t

  • Insert data into SQL Server database table with inline query, not allowed to use stored proc 2010-04-21

    I have a table in C#, the data is coming from an Excel file. I need this data to be inserted into a SQL Server 2000 table. I am not to use stored procedures. How do I program it? Any help would be appreciated. --------------Solutions------------- Do

  • Code for inserting data into SQL Server database using Enterprise library 2011-05-28

    I am new to C# Windows Application coding and using Enterprise library. I want to insert records into SQL Server 2008 database using Enterprise Library 4.1 I am getting confused between SQLCommand and DBCommand which one to use and when to use. -----

  • Error on inserting data in SQL Server db from Excel Sheet 2009-12-22

    I am inserting data from an Excel sheet to SQL Server 2005 db. I am getting this error randomly, sometimes after 20-30 records and sometimes after 1000s. I am unable to find the reason. I am using Visual Studio 2008. The CLR has been unable to transi

  • Insert data into SQl Server Database using ADO.Net Dataset 2010-08-19

    I have a small database with a table with 2 columns (ID and Name) I have an ASP.Net form that i want to input an ID and a Name and upon clicking the button, it will insert rows into the database I want to do this using a dataset. Meaning, I want to a

  • Error inserting data into SQL Server database with foreign key in ASP.NET (could not find primary key) 2011-05-19

    I am using ASP.NET MVC2 in Visual Studio 2008. I believe the SQL Server is 2005. I have two tables: EquipmentInventory and EquipmentRequested EquipmentInventory has a primary key of sCode EquipmentRequested has a foreign key called sCode based upon s

  • How to export data from SQL server database to Excel 2007 in ASP.NET? 2011-12-20

    I am developing an application where I am required to provide the functionality of exporting my SQL database to Excel 2007 format using ASP.NET. I have done it by first binding the grid and then on a click of the button the data is exported to Excel.

  • Inserting data into SQL Server database using VB.Net 2012-01-01

    I am currently using HDI Membership provider and the design looks as shown below: Now I am trying to create a new user and insert those values into the database as shown below: Try Dim connectionString As String = "Data Source=.\sqlexpress;Initial Ca

  • Cannot insert data into SQL Server database 2012-03-29

    I have already read all the previous similar posts but I couldn't find a solution. Could you please take a look at my code? I don't get any exception. I just don't see the new data in the database. int admin = 23; SqlConnection thisConnection = new S

  • Problem inserting into an SQL Server Database with Java 2011-08-18

    I have a problem because I can't insert into an sql server database: driver:[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer] public int sendCabecera(String tpv, Date date, String time, int NumPers, int CodOfi) { java.sql.DatabaseMetaData dm = n

  • Insert data in Sql Server using C# Coding using For Loop 2014-04-09

    I know my question is strange but I want to Insert data in Sql Server using For Loop using C#. I have data like as below : Insert into tblQuestions(Question, Description, Image, TopicId) values('Urogenital Diaphragm is formed by A/E', NULL, NULL, 1)

  • Trying to get data from sql server 2005 from excel macro 2010-07-13

    I am trying to get data from sql server 2005 to excel.. I have written code in excel vba Below is my code Dim strConnection, conn, rs, strSQL strConnection = "Provider=sqloledb;Data Source=LEON7269-G09\SQLEXPRESS;Initial Catalog=test;User Id=sa;Passw

  • export data from sql server 2000 to excel 2011-02-21

    Is it any method or way to export or transfer the data from sql server 2000 to excel sheet ? --------------Solutions------------- to create an EXCEL file in advance and want to export data to it, use EXEC sp_makewebtask @outputfile = 'd:\testing.xls'

  • Insert and select date from SQL Server database 2011-03-16

    I have got the following exception when try to select data from SQL Server or inserting data in in with a C# windows application. I am passing the date in where clause of select query in single quotes like this '16/03/2011' The exception message is s

  • Excel file read and save data in SQL Server database using asp.net c# 2011-08-19

    How to read an Excel file's data and save it into SQL Server database using asp.net c#? --------------Solutions------------- See OpenXML 2.0 from MS... It is a free library that does NOT require office to be installed... you can read + write Office f

  • asp.net inserting data into SQL Server db in while loop 2012-03-06

    I want to import data from Excel worksheet into SQL Server database (2008). I have successfully tested code for getting data from xls file. However, I am not able insert these data into db table. Here is the part of the code: while (ctecka.Read()) {

  • The Best Way to shred XML data into SQL Server database columns 2008-09-14

    What is the best way to shred XML data into various database columns? So far I have mainly been using the nodes and value functions like so: INSERT INTO some_table (column1, column2, column3) SELECT Rows.n.value('(@column1)[1]', 'varchar(20)'), Rows.

  • Saving binary data into SQL SErver database in vb.net 2009-09-10

    I have a string with Binarydata that is 64bit. I want to store this data into SQlServer database and the column is varbinary(Max). When I pass the string I am getting an error saying string cannot be converted into varbinary. How do I store the binar

  • Insert data into SQL server with best performance 2010-05-10

    I have an application which intensively uses DB (SQL Server). As it must have high performance I would like to know the fastest way to insert record into DB.Fastest from the standpoint of execution time. What should I use ? As I know the fastest way

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.400 (s). 13 q(s)