what is the error plz..

  • Thread starter Thread starter Jassim Rahma
  • Start date Start date
J

Jassim Rahma

I am getting this error and i Don'r know where is the problem?

please help..

An unhandled exception of type 'VistaDB.VistaDBException' occurred in
vistadb.provider.dll

Additional information: Error in dll_sql_ExecSQL
Error code: 546 Parameter not found in the list of params
Error code: 610 OpenSQL: Error:546
Parameter not found in the list of params






this is the code..

private void btnSave_Click(object sender, System.EventArgs e)
{
// save patients data;

VDBConnection.AccessMode = AccessMode.Remote;
VDBConnection.DataSource = "127.0.0.1:20211";
VDBConnection.Database = "shefaDB";
VDBConnection.LoginUser = "SA";
VDBConnection.LoginPassword = "";

VDBConnection = new
VistaDBConnection("AccessMode=Remote;DataSource=127.0.0.1;Database=shefa
DB;LoginUser = SA;LoginPassword =;");

string insertCmd = "insert into persons (PERSON_NAME, ID_TYPE,
ID_NUMBER, NATIONALITY, GENDER, DATE_OF_BIRTH, BLOOD_GROUP, COMPANY,
PROFESSION, MARITAL_STATUS, OLD_FILE_NO, PERSON_IS_VIP, ADDRESS_FLAT,
ADDRESS_BUILDING, ADDRESS_ROAD, ADDRESS_BLOCK, ADDRESS_AREA,
ADDRESS_PO_BOX, IS_OUTSIDE_COUNTRY, ADDRESS_OUTSIDE_ADDRESS,
ADDRESS_COUNTRY) values (@fullname, @idtype, @idnumber, @nationality,
@gender, @dateofbirth, @bloodgroup, @company, @profession,
@maritalstatus, @oldfileno, @isvip, @address_flat, @address_building,
@address_road, @address_block, @address_area, @address_box,
@address_is_outside_country, @address_outside, @address_country)";
// string insertCmd = "insert into persons (PERSON_NAME, ID_TYPE,
ID_NUMBER, NATIONALITY, GENDER, DATE_OF_BIRTH, BLOOD_GROUP, COMPANY,
PROFESSION, MARITAL_STATUS, OLD_FILE_NO, PERSON_IS_VIP, ADDRESS_FLAT,
ADDRESS_BUILDING, ADDRESS_ROAD, ADDRESS_BLOCK) values (@fullname,
@idtype, @idnumber, @nationality, @gender, @dateofbirth, @bloodgroup,
@company, @profession, @maritalstatus, @oldfileno, @isvip,
@address_flat, @address_building, @address_road, @address_block)";

VDBCommand.CommandText = insertCmd;
VDBCommand.Connection = VDBConnection;

VDBCommand.Connection.Open();

VDBCommand.Parameters.Add("@fullname", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@idtype", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@idnumber", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@nationality", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@gender", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@dateofbirth", VistaDBType.Date);
VDBCommand.Parameters.Add("@bloodgroup", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@company", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@profession", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@maritalstatus", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@oldfileno", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@isvip", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_flat", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_building",
VistaDBType.Character);
VDBCommand.Parameters.Add("@address_road", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_block", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_area", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@address_box", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_is_outside_country",
VistaDBType.Character);
VDBCommand.Parameters.Add("@address_outside", VistaDBType.Memo);
VDBCommand.Parameters.Add("@address_country", VistaDBType.Varchar);
/*
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
*/

// basic info
if (txtFullName.Text == "") VDBCommand.Parameters["@fullname"].Value
= null; else VDBCommand.Parameters["@fullname"].Value =
txtFullName.Text;
// VDBCommand.Parameters["@fullname"].Value = null;
VDBCommand.Parameters["@idtype"].Value = cboIDType.Text;
VDBCommand.Parameters["@idnumber"].Value = txtIDNumber.Text;
VDBCommand.Parameters["@nationality"].Value = cboNationality.Text;
VDBCommand.Parameters["@gender"].Value = cboGender.Text;
VDBCommand.Parameters["@dateofbirth"].Value = cboBirthday.Value;
VDBCommand.Parameters["@bloodgroup"].Value = cboBlood.Text;
VDBCommand.Parameters["@company"].Value = cboCompany.Text;
VDBCommand.Parameters["@profession"].Value = cboProfession.Text;
VDBCommand.Parameters["@maritalstatus"].Value =
cboMaritalStatus.Text;
VDBCommand.Parameters["@oldfileno"].Value = txtOldFileNo.Text;
if (chkVIP.Checked == true) VDBCommand.Parameters["@isvip"].Value =
"Y"; else VDBCommand.Parameters["@isvip"].Value = "N";

// address
VDBCommand.Parameters["@address_flat"].Value = txtFlat.Text;
VDBCommand.Parameters["@address_building"].Value = txtBuilding.Text;
VDBCommand.Parameters["@address_road"].Value = txtRoad.Text;
VDBCommand.Parameters["@address_block"].Value = txtBlock.Text;

if (txtArea.Text == "") VDBCommand.Parameters["@address_area"].Value
= "AA"; else VDBCommand.Parameters["@address_area"].Value =
txtArea.Text;
// VDBCommand.Parameters["@address_area"].Value = txtArea.Text;
VDBCommand.Parameters["@address_box"].Value = txtBox.Text;
if (chkOutsideAddress.Checked == true)
VDBCommand.Parameters["@address_is_outside_country"].Value = "Y"; else
VDBCommand.Parameters["@address_is_outside_country"].Value = "N";

if (txtOutsideAddress.Text == "")
VDBCommand.Parameters["@address_outside"].Value = "AA"; else
VDBCommand.Parameters["@address_outside"].Value =
txtOutsideAddress.Text;
if (cboCountry.Text == "")
VDBCommand.Parameters["@address_country"].Value = "AA"; else
VDBCommand.Parameters["@address_country"].Value = cboCountry.Text;
// VDBCommand.Parameters["@address_outside"].Value =
txtOutsideAddress.Text;
// VDBCommand.Parameters["@address_country"].Value = cboCountry.Text;

/*
VDBCommand.Parameters["@type"].Value = txtHomeTelCode;
VDBCommand.Parameters["@type"].Value = txtHomeTel;
VDBCommand.Parameters["@type"].Value = txtMobileCode;
VDBCommand.Parameters["@type"].Value = txtMobile;
VDBCommand.Parameters["@type"].Value = txtOtherTelCode;
VDBCommand.Parameters["@type"].Value = txtOtherTel;
VDBCommand.Parameters["@type"].Value = txtOfficeTelCode;
VDBCommand.Parameters["@type"].Value = txtOfficeTel;
VDBCommand.Parameters["@type"].Value = txtExtension;
VDBCommand.Parameters["@type"].Value = txtDirectTelCode;
VDBCommand.Parameters["@type"].Value = txtDirectTel;
VDBCommand.Parameters["@type"].Value = txtHomeFaxCode;
VDBCommand.Parameters["@type"].Value = txtHomeFax;
VDBCommand.Parameters["@type"].Value = txtOfficeFaxCode;
VDBCommand.Parameters["@type"].Value = txtOfficeFax;
VDBCommand.Parameters["@type"].Value = txtOtherFaxCode;
VDBCommand.Parameters["@type"].Value = txtOtherFax;
VDBCommand.Parameters["@type"].Value = txtOfficeEmail;
VDBCommand.Parameters["@type"].Value = txtPersonalEmail;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
*/

VDBCommand.ExecuteNonQuery();

MessageBox.Show("Patient's file was created successfully. Would like
to make an appointment now?");

/*
try
{
VDBCommand.ExecuteNonQuery();
MessageBox.Show("Added");
}
catch (SqlException e)
{
if (e.Number == 2627)
MessageBox.Show("ERROR: A record already exists with");
else
MessageBox.Show("ERROR: Could not add record");
}
*/

VDBCommand.Connection.Close();

// this.Close();
}


Many Thanks,
Jassim Rahma
 
Jassim,

It looks like you are specifying a parameter in your call to your
query/stored proc which doesn't exist. Are you sure you have the parameter
list correct?

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jassim Rahma said:
I am getting this error and i Don'r know where is the problem?

please help..

An unhandled exception of type 'VistaDB.VistaDBException' occurred in
vistadb.provider.dll

Additional information: Error in dll_sql_ExecSQL
Error code: 546 Parameter not found in the list of params
Error code: 610 OpenSQL: Error:546
Parameter not found in the list of params






this is the code..

private void btnSave_Click(object sender, System.EventArgs e)
{
// save patients data;

VDBConnection.AccessMode = AccessMode.Remote;
VDBConnection.DataSource = "127.0.0.1:20211";
VDBConnection.Database = "shefaDB";
VDBConnection.LoginUser = "SA";
VDBConnection.LoginPassword = "";

VDBConnection = new
VistaDBConnection("AccessMode=Remote;DataSource=127.0.0.1;Database=shefa
DB;LoginUser = SA;LoginPassword =;");

string insertCmd = "insert into persons (PERSON_NAME, ID_TYPE,
ID_NUMBER, NATIONALITY, GENDER, DATE_OF_BIRTH, BLOOD_GROUP, COMPANY,
PROFESSION, MARITAL_STATUS, OLD_FILE_NO, PERSON_IS_VIP, ADDRESS_FLAT,
ADDRESS_BUILDING, ADDRESS_ROAD, ADDRESS_BLOCK, ADDRESS_AREA,
ADDRESS_PO_BOX, IS_OUTSIDE_COUNTRY, ADDRESS_OUTSIDE_ADDRESS,
ADDRESS_COUNTRY) values (@fullname, @idtype, @idnumber, @nationality,
@gender, @dateofbirth, @bloodgroup, @company, @profession,
@maritalstatus, @oldfileno, @isvip, @address_flat, @address_building,
@address_road, @address_block, @address_area, @address_box,
@address_is_outside_country, @address_outside, @address_country)";
// string insertCmd = "insert into persons (PERSON_NAME, ID_TYPE,
ID_NUMBER, NATIONALITY, GENDER, DATE_OF_BIRTH, BLOOD_GROUP, COMPANY,
PROFESSION, MARITAL_STATUS, OLD_FILE_NO, PERSON_IS_VIP, ADDRESS_FLAT,
ADDRESS_BUILDING, ADDRESS_ROAD, ADDRESS_BLOCK) values (@fullname,
@idtype, @idnumber, @nationality, @gender, @dateofbirth, @bloodgroup,
@company, @profession, @maritalstatus, @oldfileno, @isvip,
@address_flat, @address_building, @address_road, @address_block)";

VDBCommand.CommandText = insertCmd;
VDBCommand.Connection = VDBConnection;

VDBCommand.Connection.Open();

VDBCommand.Parameters.Add("@fullname", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@idtype", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@idnumber", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@nationality", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@gender", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@dateofbirth", VistaDBType.Date);
VDBCommand.Parameters.Add("@bloodgroup", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@company", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@profession", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@maritalstatus", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@oldfileno", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@isvip", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_flat", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_building",
VistaDBType.Character);
VDBCommand.Parameters.Add("@address_road", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_block", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_area", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@address_box", VistaDBType.Character);
VDBCommand.Parameters.Add("@address_is_outside_country",
VistaDBType.Character);
VDBCommand.Parameters.Add("@address_outside", VistaDBType.Memo);
VDBCommand.Parameters.Add("@address_country", VistaDBType.Varchar);
/*
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
VDBCommand.Parameters.Add("@type", VistaDBType.Varchar);
*/

// basic info
if (txtFullName.Text == "") VDBCommand.Parameters["@fullname"].Value
= null; else VDBCommand.Parameters["@fullname"].Value =
txtFullName.Text;
// VDBCommand.Parameters["@fullname"].Value = null;
VDBCommand.Parameters["@idtype"].Value = cboIDType.Text;
VDBCommand.Parameters["@idnumber"].Value = txtIDNumber.Text;
VDBCommand.Parameters["@nationality"].Value = cboNationality.Text;
VDBCommand.Parameters["@gender"].Value = cboGender.Text;
VDBCommand.Parameters["@dateofbirth"].Value = cboBirthday.Value;
VDBCommand.Parameters["@bloodgroup"].Value = cboBlood.Text;
VDBCommand.Parameters["@company"].Value = cboCompany.Text;
VDBCommand.Parameters["@profession"].Value = cboProfession.Text;
VDBCommand.Parameters["@maritalstatus"].Value =
cboMaritalStatus.Text;
VDBCommand.Parameters["@oldfileno"].Value = txtOldFileNo.Text;
if (chkVIP.Checked == true) VDBCommand.Parameters["@isvip"].Value =
"Y"; else VDBCommand.Parameters["@isvip"].Value = "N";

// address
VDBCommand.Parameters["@address_flat"].Value = txtFlat.Text;
VDBCommand.Parameters["@address_building"].Value = txtBuilding.Text;
VDBCommand.Parameters["@address_road"].Value = txtRoad.Text;
VDBCommand.Parameters["@address_block"].Value = txtBlock.Text;

if (txtArea.Text == "") VDBCommand.Parameters["@address_area"].Value
= "AA"; else VDBCommand.Parameters["@address_area"].Value =
txtArea.Text;
// VDBCommand.Parameters["@address_area"].Value = txtArea.Text;
VDBCommand.Parameters["@address_box"].Value = txtBox.Text;
if (chkOutsideAddress.Checked == true)
VDBCommand.Parameters["@address_is_outside_country"].Value = "Y"; else
VDBCommand.Parameters["@address_is_outside_country"].Value = "N";

if (txtOutsideAddress.Text == "")
VDBCommand.Parameters["@address_outside"].Value = "AA"; else
VDBCommand.Parameters["@address_outside"].Value =
txtOutsideAddress.Text;
if (cboCountry.Text == "")
VDBCommand.Parameters["@address_country"].Value = "AA"; else
VDBCommand.Parameters["@address_country"].Value = cboCountry.Text;
// VDBCommand.Parameters["@address_outside"].Value =
txtOutsideAddress.Text;
// VDBCommand.Parameters["@address_country"].Value = cboCountry.Text;

/*
VDBCommand.Parameters["@type"].Value = txtHomeTelCode;
VDBCommand.Parameters["@type"].Value = txtHomeTel;
VDBCommand.Parameters["@type"].Value = txtMobileCode;
VDBCommand.Parameters["@type"].Value = txtMobile;
VDBCommand.Parameters["@type"].Value = txtOtherTelCode;
VDBCommand.Parameters["@type"].Value = txtOtherTel;
VDBCommand.Parameters["@type"].Value = txtOfficeTelCode;
VDBCommand.Parameters["@type"].Value = txtOfficeTel;
VDBCommand.Parameters["@type"].Value = txtExtension;
VDBCommand.Parameters["@type"].Value = txtDirectTelCode;
VDBCommand.Parameters["@type"].Value = txtDirectTel;
VDBCommand.Parameters["@type"].Value = txtHomeFaxCode;
VDBCommand.Parameters["@type"].Value = txtHomeFax;
VDBCommand.Parameters["@type"].Value = txtOfficeFaxCode;
VDBCommand.Parameters["@type"].Value = txtOfficeFax;
VDBCommand.Parameters["@type"].Value = txtOtherFaxCode;
VDBCommand.Parameters["@type"].Value = txtOtherFax;
VDBCommand.Parameters["@type"].Value = txtOfficeEmail;
VDBCommand.Parameters["@type"].Value = txtPersonalEmail;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
VDBCommand.Parameters["@type"].Value = ;
*/

VDBCommand.ExecuteNonQuery();

MessageBox.Show("Patient's file was created successfully. Would like
to make an appointment now?");

/*
try
{
VDBCommand.ExecuteNonQuery();
MessageBox.Show("Added");
}
catch (SqlException e)
{
if (e.Number == 2627)
MessageBox.Show("ERROR: A record already exists with");
else
MessageBox.Show("ERROR: Could not add record");
}
*/

VDBCommand.Connection.Close();

// this.Close();
}


Many Thanks,
Jassim Rahma
 
Back
Top