How To Update Database Name?? 关注

0
Avatar
Legacy Poster

Hello
I made ".btw" template "MyDatabase" refers to label formtat's database connection's name, but i need to set the OLEDB connection to another database name on same server through .Net coding.

like
OLEDB oleDB = new OLEDB("AnotherDatabase");
oledb.UserID = "Admin";
oledb.SetPassword("newpassword");
oleDB.SQLStatement = "SELECT `Calories` FROM `NutritionInformation`";

is it i need to create this new connection on the ".btw" template also?? it must match database name on .btw template and database we passed from code??
is there any way that I can change database of template through .Net code??

2 评论

0
Avatar
Ian Cummings
版主
评论操作 固定链接

It is not possible to change the database in use by a BarTender document via automation. This change will need to be made in the BarTender template itself from within BarTender. In automation you can specify a custom SQL select statement or set query values and login credentials, but you cannot specify a new connection.
0
Avatar
Legacy Poster
评论操作 固定链接

Ok Thanx for reply

请先登录再写评论。