connect db to crystal report
-
i,m using c#2005 and sqlexpress. in my projects i use separate class for db connection and call that on project. there i use connection string as ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database\\stock.mdf;Integrated Security=True;User Instance=True"; as i understand this db created on project location and it attached to sql server when project(or build exe) running. after successfully build project i could see db had attached to server as "D:\Equipmanager\Equipmanager\bin\Debug\Database\stock.mdf" everything ok.db connection works fine. but problem comes when i start reports. there i tried on ADO.net and OLE DB.but wizard shows only default dbs.master etc....(actually my project db attached to server when running.show how it show there?) here's my problem... 1. can i use this connection string...is there any problem... 2. how to use project db for reporting(use crystal report)..?should i attached db manually and do report? if i use sql 2000 this problem ok.because there every db is attached and not separate file. currently i get db details by code and pass those to report(actually this connection string fine.because when deploying db is automatically attached.no need to do it manually) but passing parameter is not good when long report.that's why i want to find way connect db to report?
-
i,m using c#2005 and sqlexpress. in my projects i use separate class for db connection and call that on project. there i use connection string as ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database\\stock.mdf;Integrated Security=True;User Instance=True"; as i understand this db created on project location and it attached to sql server when project(or build exe) running. after successfully build project i could see db had attached to server as "D:\Equipmanager\Equipmanager\bin\Debug\Database\stock.mdf" everything ok.db connection works fine. but problem comes when i start reports. there i tried on ADO.net and OLE DB.but wizard shows only default dbs.master etc....(actually my project db attached to server when running.show how it show there?) here's my problem... 1. can i use this connection string...is there any problem... 2. how to use project db for reporting(use crystal report)..?should i attached db manually and do report? if i use sql 2000 this problem ok.because there every db is attached and not separate file. currently i get db details by code and pass those to report(actually this connection string fine.because when deploying db is automatically attached.no need to do it manually) but passing parameter is not good when long report.that's why i want to find way connect db to report?
-
did you try copy your mdf file to near of other standard mdf file, maybe it can checks constant path
sorry i can't get what you'r saying.could you please explain
-
sorry i can't get what you'r saying.could you please explain
Sorry for late reply, you have said that your mdf file is on D:\Equipmanager\Equipmanager\bin\Debug\Database\stock.mdf, right. but if you use wizard you said that you can see default database(like master), and i suggest you copy stock.mdf to master.mdf's folder I wish to it is ok for you
-
Sorry for late reply, you have said that your mdf file is on D:\Equipmanager\Equipmanager\bin\Debug\Database\stock.mdf, right. but if you use wizard you said that you can see default database(like master), and i suggest you copy stock.mdf to master.mdf's folder I wish to it is ok for you
thx. but that's not working.. now i use this way create dataset and populate it using database table and write xmlschema from dataset then use xml file as database file of report.it works fine