question

Doom-8980 avatar image
0 Votes"
Doom-8980 asked AnuragSharma-MSFT commented

Visual Basic app to connect to an online database

Hey Microsoft Community,

I have an app with a login (name, email, and password) form and since it's hard to keep track of how many users are using the app, I want to know if it's possible and how to connect my Visual Basic application to an online database where I can access it. The app is made in Visual Basic 2010 Express Edition and I would need some advice on how to do this database + some good online, 24/7 database hosting services. Searched all over youtube but looks like an open desert with no answers.

Thanks for reading and please help me with this, I would really use a database.

azure-sql-databasedotnet-visual-basic
· 2
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.

I converted this comment to an answer; see below.

0 Votes 0 ·

Hi @Doom-8980, just wanted to check if you need any more details on this. You can accept the answer if it helped.

0 Votes 0 ·
AlbertoMorillo avatar image
0 Votes"
AlbertoMorillo answered

Here you will find how to create an Azure SQL Database, 24 x 7, and starts with approximately USD$5/month (basic tier). Make sure to add your current Internet IP address to the whitelist of Azure SQL Database firewall so your application can connect from your location. Use this documentation to configure Azure SQL firewall.

Download and install SQL Server 2012 Native Client from here.

Modify the connection string for your application:

Private Function GetSqlServerConnectionString() As String
GetSqlServerConnectionString = "Driver={SQL Server Native Client 11.0};"
& "Server=tcp:YourAzureSQLServerName.database.windows.net,1433;"

& "Database=YourDatabaseName;"
& "Uid=YourAzureSQLAdminUser;"

& "Pwd={xxxxxxxx};"
& "Encrypt=yes;"

& "Connection Timeout=30;"
End Function



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.

SimpleSamples avatar image
0 Votes"
SimpleSamples answered SimpleSamples edited

Creating and connecting to an Azure database is the easy part. There are abundant resources about that. For one thing, most anything showing how to connect to a SQL Server database can be used to connect to an Azure database; you simply use an appropriate connection string.

The hard part is keeping track of who is using the app. Is this one system executing many instances of the application? Probably not. I assume it is many systems, each executing separate instances. So you need to have a way for them to communicate. You can do that using a peer-to-peer mechanism (which would be too complicated) or you can create a server that each of them communicates with. Where will that server be? You can create a service in Azure that provides that.

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.

SimpleSamples avatar image
0 Votes"
SimpleSamples answered

I did a little research and found Application Insights. I know nothing except what that page and the following says.

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.