Hi Experts:
When i run this page on my online website with mysql (already with Oracle), this errors orrurs.

Exception Details: System.Data.OleDb.OleDbException: [1]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exec print_pack.check_print ?, ?' at line 1

Source Error:


Line 92: prm.Value=app;
Line 93: bool prt=false;
Line 94: comm.ExecuteNonQuery();
Line 95:
Line 96: string title="",uid="",uname="";


Source File: c:\Domains\ict-m.com\ict-m.com\wwwroot\ictm\soft\Reports\print.aspx Line: 94

Made me mad,

I need help plz .

<script type="text/javascript">
function sel(theElement) {
	
     var theForm = theElement.form, z = 0;
	 var t=theForm["no"].value;
	 var tx='';
	
	for (i=1;i<=t;i++)
	{
		var el=document.getElementById('print_'+i);
		if (el.type=='checkbox' && ! el.disabled)
			el.checked=theElement.checked;
	}
}

function sel2(theElement)
{
	for (i=1;i<=2;i++)
	{
		var el=document.getElementById('1print_'+i);
		if (el.type=='checkbox')
			el.checked=theElement.checked;
	}
}

function prev2(no){
	var frm=document.getElementById('frm');
	frm.target="_blank";
	frm.action='prev_Project.aspx?n='+no;
	frm.submit();
}

function ms(t)
{
	var frm=document.getElementById('frm');
	frm.action="save_project.aspx";
	frm.target="_self";
	frm.submit();
}


function m(t)
{
	var frm=document.getElementById('frm');
	frm.action="merge_project.aspx";
	frm.target="_blank";
	frm.submit();
}
</script>

<%
OleDbConnection conn=new OleDbConnection(System.Configuration.ConfigurationManager.AppSettings["MM_CONNECTION_STRING_ictmdb"]);
conn.Open();
OleDbCommand comm=null;
OleDbDataReader dr=null;
OleDbParameter prm=null;
DataSet ds=new DataSet();
    
comm=new OleDbCommand("print_pack.check_project",conn);
comm.CommandType=CommandType.StoredProcedure;
prm=comm.Parameters.Add("@proj_id",OleDbType.VarChar);
prm.Value=project_id;
comm.ExecuteNonQuery();
    
string ptitle = "", uid = "", uname = "", compname="",Pintr="Y",Pprjflw="Y";
string prjType = Session.Contents["project_type"].ToString().Trim();
    
comm=new OleDbCommand("select * from ictm_project where project_id='"+project_id+"'",conn);
dr=comm.ExecuteReader();
if (dr.Read()){
	ptitle=dr["description"].ToString();
    uid =(string) dr["admin_id"].ToString().Trim();
}
dr.Close();

if (uid == user_id) { uauth = "pl"; }
//----------  Get Username from employees table

    
comm = new OleDbCommand("select * from ictm_user where company_id='" + Session.Contents["comp_id"].ToString() + "' and user_id='" + uid + "' ", conn);
dr = comm.ExecuteReader();
if (dr.Read()) { uname = (string)dr["user_name"].ToString().Trim(); }
dr.Close();    

    
    //----------  Get Companyname from the  table    
comm = new OleDbCommand("select comp_name from ictm_company where company_id='" + Session.Contents["comp_id"].ToString() + "' ", conn);
dr = comm.ExecuteReader();
if (dr.Read()) { compname = (string)dr["comp_name"].ToString().Trim(); }
dr.Close();


OleDbDataAdapter adp = new OleDbDataAdapter("select pt.user_id,pt.proj_id,ap.description appname,nvl(pt.title, '  ') title,pr.print,pt.app_id from ictm_print_project pr,ictm_application ap,"
	   +" ictm_project_detail pt where pt.proj_id=pr.proj_id and pr.project_id='"+project_id+"' and pt.app_id=ap.app_id order by pr.row_no",conn);
adp.Fill(ds,"prt");
DataTable tb=ds.Tables["prt"];


string fpath = "";

    
fpath = Request.PhysicalApplicationPath.ToString();
fpath = fpath + "soft\\tmp\\reports\\final\\";

i=0;
%>

Recommended Answers

All 2 Replies

Yes I am using MySql with Mysql OLEDB Provider API , already running there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.