Answered by:
How to change the locations where SQL server instance name are sssigned to variable?

Question
-
I downloaded a sample SQLExpressProviderSample from http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=1200. (SQL Express - Client Synchronization Sample (C# v2.0 CTP1) )
How to change the locations where SQL server instance name are sssigned to variable?
I am using SQL dev version instead of express version.
Here is an error occured in syncform.cs and tests.cs when complile. I replace @"\SQLEXPRESS" with @"\mypc_name" but no luck.
textServerMachine.Text = Environment.MachineName + @"\SQLEXPRESS";
Thursday, March 4, 2010 3:33 PM
Answers
-
Sorry, I did not realize that this project including two folders. Once convert both folders "SQLExpressProviderSample" and "SqlExpressClientSyncProvider", the error above was gone.
- Marked as answer by Sid Singh [MSFT]Microsoft employee Monday, March 15, 2010 7:01 PM
Thursday, March 4, 2010 8:49 PM
All replies
-
have you checked what the instance name is of your SQL installation. For SQLEXPRESS, the default would be "<yourmachinename>\SQLExpress". So if your machine name is "mypc_name", the correct value should be "mypc_name\SQLEXPRESS".Thursday, March 4, 2010 4:19 PM
-
I found out.
Since I am using SQL devoloper version, so the answer is
textServerMachine.Text = Environment.MachineNameThursday, March 4, 2010 4:46 PM -
Another problem.
Once I convert C# to VB, there is an error:
Imports
Microsoft.Samples.Synchronization.Data.SqlExpress
There is no samples under microsoft.Thursday, March 4, 2010 5:22 PM -
that's the original namespace in the SqlExpressClientSyncProvider.cs file. Are you sure you didn't change the namespace when you converted to VB?Thursday, March 4, 2010 6:35 PM
-
I used "instant vb" utility to convert it. I found that entire folder "SQLExpressClientSyncProvider" did not convert.
Thursday, March 4, 2010 8:00 PM -
Hello aspfun,
Often times, sql server instance names match the machien name.
If not the same, I usually try "osql -L" command to find out the correct one.
I am sure there are other ways to achieve this.
Thanks,
PatrickThursday, March 4, 2010 8:05 PM -
Sorry, I did not realize that this project including two folders. Once convert both folders "SQLExpressProviderSample" and "SqlExpressClientSyncProvider", the error above was gone.
- Marked as answer by Sid Singh [MSFT]Microsoft employee Monday, March 15, 2010 7:01 PM
Thursday, March 4, 2010 8:49 PM