Search : in
By :

Connecting SQL Server 2005 db with ASP.NET

Eskimo, on Jun 11, 2009 9:46:44 am BST 
 Report this message to moderators

Hello,

I used the following c# coding to connect SQL SERVER 2005 with Visual Web Developer 2005 ASP.Net website I'm developing.

SqlConnection con = new SqlConnection("Server=.\SQLEXPRESS;Database=bsbc.mdf;Trusted_Connectopn=True");
SqlCommand cmd = new SqlCommand("INSERT INTO customer VALUES('"+txtCusId.Text+"', '"+txtCusName.Text+"', '"+txtContactNo.Text+"', '"+txtAddSt1.Text+", "+txtAddSt2+", "+txtAddCity+"', '"+txtCusEmail.Text+"')");
con.Open();
DataSet ds = new DataSet(cmd, con);
SqlDataAdapter da = new SqlDataAdapter();
da.Fill(ds);
con.Close();

But it doesn't get compiled and says, 'Could not find schema information for the element' in the Web.config file. Do I have to add any code in the Web.config file? Greatly appreciate support in fixing this problem. I cannot proceed with any other work without the database connectivity done.

Advance thanks

Configuration: Windows XP
Firefox 3.0.10

Best answers for « Connecting SQL Server 2005 db with ASP.NET » in :
Automatic backup of a Database in SQL EXPRESS 2005 ShowAutomatic backup of a Database in SQL EXPRESS 2005 If you want to automate a backup of a database in SQL Server Express, there is a simple solution using a .bat. file. Create a new text file. This file should contain the following...
Visual FoxPro and SQL Server ShowVisual FoxPro and SQL Server Visual Foxpro 9 and SQL Server 2005 Is there a better alternative than using Visual FoxPro to manage efficiently a SQL Server? Here's an interesting issue. For more information see the article:...
ASP.NET using C# - How to Connect/Retrieve in database to web a ShowASP.NET using C# - How to Connect/Retrieve in database to web application Issue Solution Note Issue I am doing my project work, I have one problem My project doing in asp.net but I don't know how to connect the database in asp.net...
Download EMS Data Export for SQL Server ShowDo you need to analyze your data in your SQL Server database? Would you like to print them? EMS Data Export for SQL Server offers to export them into MS Access, MS Excel, MS Word, RTF, HTML, XML, PDF, TXT, CSV, DBF or ODF only in a few steps. This...
ODBC ShowWhat is ODBC? ODBC stands for Open Database Connectivity. This is a Microsoft-defined format for communicating between Windows database clients and consumer DBMSs. The ODBC managier can be found in Windows 3.1 and 9x. In Windows 95 and 98, it is...
Business intelligence ShowIntroduction to business intelligence The term business intelligence (BI) refers to the use of company data to facilitate decision-making by decision-makers, i.e. understanding current functioning and anticipating actions for well-informed steering...