question

NicholasPiazza-0093 avatar image
0 Votes"
NicholasPiazza-0093 asked NicholasPiazza-0093 commented

Windows Forms Database Project Problem with Data Sources

I am trying to setup the example Windows Forms SampleDatabaseWalkthrough example in Microsoft document
https://docs.microsoft.com/en-us/visualstudio/data-tools/create-a-sql-database-by-using-a-designer?view=vs-2019#add-a-data-source. However, when I try to open the Data Sources window as indicated in the instructions, I get the message:
This window is not supported for the selected project. For steps to enable data binding, please visit:
https://aka.ms/WinForms/DataBinding
However, that page has a large number of links that would seem to take forever to read. Could you give me a more direct answer to the project. Here is a copy of the project file:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<LangVersion>9.0</LangVersion>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

</Project>
I have already created the SampleDatabase MDF and LDF files.

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Viorel-1 avatar image
1 Vote"
Viorel-1 answered NicholasPiazza-0093 commented

According to documentation, you should create a different kind of projects: “Windows Forms App (.NET Framework)”.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OK, that works. I was just hoping that Microsoft would have a new .NET 5.0 example of this database project ready to go.

0 Votes 0 ·