471,354 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

what is the error plz..

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=12 7.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_cou ntry",
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

*** Sent via Developersdex http://www.developersdex.com ***
Jan 6 '06 #1
1 1198
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]
- mv*@spam.guard.caspershouse.com

"Jassim Rahma" <jr****@hotmail.com> wrote in message
news:O4****************@TK2MSFTNGP15.phx.gbl...
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=12 7.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_cou ntry",
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

*** Sent via Developersdex http://www.developersdex.com ***

Jan 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

72 posts views Thread by E. Robert Tisdale | last post: by
6 posts views Thread by Daniel Rudy | last post: by
13 posts views Thread by Jason Huang | last post: by
10 posts views Thread by Protoman | last post: by
669 posts views Thread by Xah Lee | last post: by
4 posts views Thread by grizggg | last post: by
5 posts views Thread by =?GB2312?B?17/HvyBaaHVvLCBRaWFuZw==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.