Keyword not supported: 'datasource'

Keyword not supported: 'datasource'

Page 1 of 1

2 Replies - 4593 Views - Last Post: 25 August 2009 - 07:31 AM Rate Topic: -----

#1 deleon_chesterhomer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 184
  • Joined: 08-September 07

Keyword not supported: 'datasource'

Posted 24 August 2009 - 11:52 PM

i dont know how to fix this problem, it says that on line 23 there's an error.. hope you can help me fix it.. :)
:)




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.ArgumentException: Keyword not supported: 'data
source'.



using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

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

	}

	public void insertDataIntoDB(string fname, string lname, string email, string tel)
	{

		string conn = System.Configuration.ConfigurationManager.ConnectionStrings["dbConnectionString"].ConnectionString;
		System.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection(conn);
		string MySQL = "StoredProcedure1";
		System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(MySQL, myConnection);
		cmd.CommandType = System.Data.CommandType.StoredProcedure;
		cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Fname", fname));
		cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Lname", lname));
		cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Email", email));
		cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Tel", tel));

		myConnection.Open();
		cmd.ExecuteNonQuery();
		myConnection.Close();

	}
	protected void Wizard1_FinishButtonclick(object sender, WizardNavigationEventArgs e)
	{
		insertDataIntoDB(TextBox1.Text.ToString().Trim(), TextBox2.Text.ToString().Trim(), TextBox3.Text.ToString().Trim(), TextBox4.Text.ToString().Trim());
	}
}






Is This A Good Question/Topic? 0
  • +

Replies To: Keyword not supported: 'datasource'

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Keyword not supported: 'datasource'

Posted 25 August 2009 - 05:25 AM

the connection string in your settings file is not formatted correctly. Can you post it?
Was This Post Helpful? 1
  • +
  • -

#3 deleon_chesterhomer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 184
  • Joined: 08-September 07

Re: Keyword not supported: 'datasource'

Posted 25 August 2009 - 07:31 AM

oh yeah i fix it already thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1