I'm need some guidance on how to connect .NET MAUI with my local SQL Server database. I've been using C# WinForms and SQL Server for a while now, but I'm not sure how to proceed with .NET MAUI.
My goal is to perform some CRUD operations from an Android emulator to my local SQL Server database. I'd really appreciate any advice on how to achieve this. If I need to write an API for this scenario, I'd love some help with that as well.
Thank you in advance for your help!
I have tried connect the SQL Server database directly using Microsoft.Data.SqlClient;
but it works only on windows machine, but not in android emulator.
1条答案
按热度按时间t98cgbkg1#
As someone said, usually you don't call it directly for security reasons. But If yo are just looking to test then you can do it just like you do it locally:
Write a service for retrieving an object:
Then in your button call just call the service: