开发者

Subsonic is not connected to SQL Server

开发者 https://www.devze.com 2023-01-27 20:32 出处:网络
I am not sure if I even phrased correctly the title. I am very new to Subsonic. I have installed SubSonic in Visual Studio. I have follo开发者_C百科wed the configuration steps as presented in the tuto

I am not sure if I even phrased correctly the title. I am very new to Subsonic. I have installed SubSonic in Visual Studio. I have follo开发者_C百科wed the configuration steps as presented in the tutorial of SubSonic. The problem is:

I try in my default.cs to reference Northwind in order to access its tables, but Northwind does not exist in the intellisense. So if I am not wrong Visual Studio does not see the database. Is there smtg wrong with my below connection string?

<connectionStrings>
   <add name="Northwind" 
        connectionString="Data Source=VERONIQUE-PC;Database=Northwind;Integrated Security=true;">
</connectionStrings>

I forgot to say that I use .Net Framework 2.0, so I installed the 2.1 version of SubSonic. I also use SQL Server 2005

I would appreciate your help.


  1. Since you want to leverage BuildProvider make sure you're doing all those steps in Web Site project (not Web Application)
  2. Add configuration stuff (you already done this)
  3. Add "App_Code" to the solution in Visual Studio
  4. Create a text file, e.g. model.abp in App_Code folder and add some content into it (for example, just type one star * or anything else)
  5. Press F6, wait until it completes the build, then go to default.aspx.cs and try to type Northwind. you should see IntelliSense.

But I always prefer generating the model via Command Line tool instead of build provider because it's not dependent on project type and you can integrate it to automated builds.

0

精彩评论

暂无评论...
验证码 换一张
取 消