4 Replies - 11353 Views - Last Post: 18 March 2013 - 03:01 PM Rate Topic: -----

#1 dq1406  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-March 13

'SqlCommande' does not contain a definition for 'Parameter

Posted 18 March 2013 - 02:08 PM

Hi guys

I'm working on my project and I need help please :sweatdrop:

I dont know how to fix it


Compiler Error Message: CS1061: 'SqlCommande' does not contain a definition for 'Parameters' and no extension method 'Parameters' accepting a first argument of type 'SqlCommande' could be found (are you missing a using directive or an assembly reference?)

and this is my code

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


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

    }
    protected void RadioButtonList2_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        // Declare objects 
        SqlConnection registerConn = new SqlConnection();
        SqlCommande registerCmd = new SqlCommande();

        //Requirement 
        registerConn.ConnectionString = ConfigurationManager.ConnectionStrings[1].ToString() ;
        registerCmd.Connection = registerConn;
        registerCmd.CommadeType = CommandType.StoredProcedure;
        registerCmd.CommandText = "MangMemebers";
        registerCmd.Parameters.AddWithValue("@check", "a");
        registerCmd.Parameters.AddWithValue("@UserName", TextUserName.Text);
        registerCmd.Parameters.AddWithValue("@FirstName", TextName.Text);
        registerCmd.Parameters.AddWithValue("@PassWord", TextPass.Text);
        registerCmd.Parameters.AddWithValue("@Email", TextEmail.Text);
        registerCmd.Parameters.AddWithValue("@Gender", RBLGender.SelectedValue);
        registerCmd.Parameters.AddWithValue("@BirthDay", TextBirth.Text);
        registerCmd.Parameters.AddWithValue("@Contery", DDLC.SelectedValue);
        registerCmd.Parameters.AddWithValue("@Qustion", DDLQ.SelectedValue);
        registerCmd.Parameters.AddWithValue("@Answer", TextAns.Text);
        
        
        // DB work 
        registerConn.Open();
        registerCmd.ExecuteNonQuery();
        LM.Text = "User Added Successfully";

        registerConn.Close();
    }

    public object CommadeType { get; set; }
}



please help me :helpsmilie:

Is This A Good Question/Topic? 0
  • +

Replies To: 'SqlCommande' does not contain a definition for 'Parameter

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8396
  • View blog
  • Posts: 31,234
  • Joined: 12-June 08

Re: 'SqlCommande' does not contain a definition for 'Parameter

Posted 18 March 2013 - 02:13 PM

38	        SqlCommande registerCmd = new SqlCommande();


It told you the problem.. with 'SQLCommande'. There's no 'e' in SQLCOmmand.
Was This Post Helpful? 1
  • +
  • -

#3 dq1406  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-March 13

Re: 'SqlCommande' does not contain a definition for 'Parameter

Posted 18 March 2013 - 02:30 PM

WOW :blush: first thanks for your fast replay and second thanks for your help it's work

but there is another error came up :huh:

<< she's new so please bear with me :stupid:

Compiler Error Message: CS1061: 'ASP.register_aspx' does not contain a definition for 'TextName_TextChanged' and no extension method 'TextName_TextChanged' accepting a first argument of type 'ASP.register_aspx' could be found (are you missing a using directive or an assembly reference?)
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8396
  • View blog
  • Posts: 31,234
  • Joined: 12-June 08

Re: 'SqlCommande' does not contain a definition for 'Parameter

Posted 18 March 2013 - 02:40 PM

Again... check the names. Are they spelled right? Are they declared right? .. etc.
Was This Post Helpful? 1
  • +
  • -

#5 dq1406  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-March 13

Re: 'SqlCommande' does not contain a definition for 'Parameter

Posted 18 March 2013 - 03:01 PM

ok now how can I thank you ?

I hope you have a nice day

thanks Brother\ sister :flowers: :flowers: :flowers:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1