please solve this problem

Posted by Arunamalraj under DotNetFunda.Com on 5/28/2012 | Points: 10 | Views : 990 | Status : [Member] | Replies : 1
i am trying to store the csv file into the sql server database using asp dot net.
but i got this error . so kindly correct error and show to me.
i got a assembly reference error. so which reference i have to use this program,and how to add the reference

using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.IO;

public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)

protected void btnimport_Click(object sender, EventArgs e)
SqlConnection con = new SqlConnection();
con.ConnectionString=("Data source=ARUNAMALRAJ-PC;Initial catalog=csvtest;user id=sa;password=root");
StreamReader sr = new StreamReader("D:\test.csv");
string line;
string SQL="insert into[data1]([name],[age])values(@name,@age)";
SqlCommand cmd = new SqlCommand(SQL,con);
cmd.Parameters.AddWithValue("@age", line[1]);



Posted by: Rajkatie on: 5/28/2012 [Member] [MVP] Gold | Points: 25

Please provide your actual error message

Rajesh Patel
.Net Trainer(MSCD | MCT | MS)
Brainbench (Asp.Net 4.5 and C# 5.0)

Arunamalraj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response