oleDB connection: getting exception querying MDX from C# -
please: receive following exception when trying run code:
object reference not set instance of object...
using (oledbconnection conn = new oledbconnection(@"provider=msolap.4; data source=<mysource>; initial catalog=analysis componetreport;")) { conn.open(); var mdxquery = new stringbuilder(); mdxquery.append("select non empty { [measures].[afr] } on columns, [dim_component_basic].[kp mat nr].children on rows (select [dim_component_basic].[kp mat nr].&[" + partnumber + "] on columns [cub componenten])"); using (oledbcommand cmd = new oledbcommand(mdxquery.tostring(), conn)) { //dataset ds = new dataset(); //ds.enforceconstraints = false; //ds.tables.add(); datatable dt = new datatable(); dt.load(cmd.executereader()); try { part.partnumber = dt.rows[0][0].tostring();
the error occured @ dt.load(cmd.executereader())); part.
now: swear same code worked 2 days ago. , if change oledb part adomd works well.
however can't use adomd connection because don't want use windows authentification.
Comments
Post a Comment