in the previous video we created a
mariah db
database server uh in the cloud
and we also installed the sample
northwind database
so in this video we're going to create a
named connection string that points to
our cloud database so that we can use
this database in
our alpha anywhere applications so we'll
start off
by checking the mariah db database yeah
to indicate that this action that we're
going to perform
is going to be on this mariah tv
database then we'll go over to actions
and we'll say get connection string so
here's our connection string
to that database server but it's not yet
pointing to
the actual database that we created so
we'll go here and say save as named
connection
and then we'll go there and we'll select
the database that we created
and so now when we go ahead and i'm
going to just go here and change this to
cloud and then hit save
so now we're creating a named connection
that is pointing to our
sql cloud database so we'll go ahead
then click ok
hit the close button
and then close this down going into
alpha and we're going to go
try and use that name connection so
we'll go over here
and we'll create a new we'll go to the
web control panel
and we'll create a new ux component
so we'll build we'll take a list control
and then here we'll go and we'll say
it's going to be a sql
list we'll choose our connection string
so there's that connection that we just
created and we'll go and
choose our table so
here are all the tables in that database
that we created so we'll go ahead and
choose the customer table
and now we can go and choose which
fields we want so we'll go ahead and
choose say
those fields and then go to our list
layout
and choose our fields click ok
we'll save this as ux
test and then we'll switch over to
working preview so you can see there's
our
list control now getting the data from
this cloud sql database
we can also go to the interactive window
and
interact with this database using
x basic so we'll go here to interactive
window and we'll do
so we'll dim a new connection object
and then we'll go and we'll open our
connection
and we'll choose their cloud variety be
and let's just put a question mark in
front of it to see if the command is
successful
you can see it is successful and it
opens up very quickly
so you'll notice that it opens up very
quickly because we've previously
connected to the database when we ran
the list
and when we ran the list we opened up
the ssh tunnel
so if the ssh tunnel is not currently
open
then the first time you connect you'll
see this delay but once the ssh tunnel
is
open the connection is essentially
instantaneous i'm now going to go here
and say cn dot
list tables
and that gives me a list of all the
tables in our cloud sql database
so what we've shown over here is how you
can build a connection string that
points to your cloud sql database
and then you can use that connection in
your alpha anywhere applications
just as if you were working with a local
sql database
thanks very much
Customer Support