Getting Started With LightSwitch Beta
4K views
Nov 21, 2023
Getting Started With LightSwitch Beta
View Video Transcript
0:00
In this video we will talk about visual studio light switch product Microsoft just announced beta one
0:07
so if you you been watching my blogs or C sharp corner blogs if you see right here blogs
0:17
I've been writing on visual studio light switch recently so if you go to my blog or just click here you will see I have bunch of few
0:29
have bunch of few beginner articles and links on visual studio light switch so
0:36
first thing you want to know is why do I need this another version of visual
0:42
studio which isn't this current version 2005 2008 2010 aren't they enough what
0:49
is this visual studio light switch and why do I need it well let's say
0:54
microsoft is trying its hands on non-programmers now so people these are
1:01
business people they have no idea how to write code but they do know what kind of
1:07
application they want and what data they want to see on their user interfaces so
1:15
but it doesn't mean that programmers or developers are can't use light switch
1:21
sure we can too if you give me a tool and I can write my application without
1:26
writing a single line of code why wouldn't I use it absolutely I'll use it
1:31
too so that's where Visual Studio light switch comes so if you click in one of
1:37
these links it will tell you where to download Visual Studio light switch
1:44
it's download is very simple okay you don't have to have a big really big
1:50
download what you are going to do is as long as you have visual studio 2010
1:54
installed on your machine if you do have that what you are going to really do it
1:59
just install this small light switch and it adds templates to your existing
2:05
visual studio 2010 so you can click this link and you download and just follow
2:11
the installation instructions so let's so after you download and install visual
2:17
studio light switch oops there is a spelling mistake right here I can see it so anyway
2:24
so let's get back to this so close I'm going to close this blog screen and now I'm jumping
2:29
back to my visual studio 2010 so after installing visual studio 2010 I did install visual studio
2:37
light switch from the link you just saw as soon as you install what you are going to
2:43
see is if you go say file new project you are going to see a new folder for
2:51
templates added here called light switch in this you see dotnet framework 4 is
2:57
selected and there are two templates added here one is for C sharp
3:01
applications and one is for visual basic right now this is beta 1 so what
3:08
visual studio to the light switch does it only gives you a simple application but
3:14
eventually goal is using the light switch you should be able to create
3:18
windows forms applications WPF applications silver light applications your ASP.NET web applications so all kind of applications so so let's get
3:30
started once you get started and you go through this video you'll get a better
3:34
idea why and you will see why this live switch product is really cool and important
3:44
So I select the C sharp here and in my junk folder as I always do that I going to create my authors dashboard
3:57
so I'm going to create an application called authors dashboard and I'll say ok
4:16
now as soon as your project is created what you are going to see is
4:27
you will see two options in the designer one is called create new table
4:36
second one is attached to external database so any application created in light switch
4:43
needs a database if you do have a database you can select the attached to
4:49
external database option if you do not have a database it will allow you to
4:54
create actually database database and fill data here and actually it will do
4:59
everything for you without even writing a single line of code so now let's get
5:06
get back to our question why do I need silver light switch so answer is so I'm a business guy I have no idea I don't have SQL server oracle I don't even know how to build the databases but I know what kind of data I need and I want to build my application that's where I think for now light switch would be used and it's handy tool it's like you know it's like a
5:36
tool where you don't really need to write any code so let's get back to let's
5:40
create a new table this will give you more idea so I say create new table so
5:48
as soon as you do that you will see a form is open and in this form you can
5:53
type all your table and column names I'll say alright name obviously string
6:01
type and next I can go to let's say age I'll say integer
6:09
I'll say address string and photo
6:53
so what I'm here right now I'm creating a author table where I have author details name, age, address, photo, bio and
7:03
you know any other fields you want to add to this thing one thing you will notice here is at the top of this
7:10
in the top bar you will see I can add relationships I can compound property, query, screen, new table and bunch of other things
7:19
And here if you look at the solution explorer you'll see a data sources folder is
7:26
added and within that there's another folder which is a database called application data and that there's the item, table 1 items
7:34
So right now you see there are two folders here one is called data source and the other one is the screen now there is no screen but eventually we are going to add a screen so first thing this application needs is data so if you say save you can also actually change the name
7:56
of this table say rename I'm going to rename it to say author one other thing that you
8:06
can do is say right click here and you'll say add another table so you can
8:12
also add another table so for example I'm going to say create another I'll add
8:19
that table later so first let's just add one table before I get into more details
8:26
into this database how to build different complex application let's just look at how powerful this tool is so now our data is ready our actually not data is not ready but we
8:40
know what data we want to capture from an application and what data you want to display now next option
8:47
is you need to create a screen screen is basically a user interface where you can view add update and
8:53
delete the data so i click if you click on plus screen you will see this add new screen wizard or
9:04
dialog pops up where you can see you want to add a new screen data search screen data detail screen
9:09
data editable grid screen list and detail screen so let's just go for new data screen for now and
9:16
screen name we are going to call it add author. Screen data as you see we are going to capture from author item we just added a minute ago
9:28
That means this form here is going to look like the data we just built in the background
9:36
And now say ok. Now as soon as you click ok what you are going to see is you will see there is an
9:46
author item property this is your basically you can say class where you see id name by address they are exactly
9:53
mapping with the data we just added and then this is our actual
10:01
that's where we can actually change if you want to but this is just displaying okay
10:10
these are controls corresponding mapping a property or a column name in our database so you can see
10:19
okay this is how our application is going to look like it will have two rows
10:23
first row is going to say add author second is screen command bar and that
10:28
you will see there's a command bar where you'll see text box text box text box image editor
10:34
and you can add more you can even add custom more if you want to
10:39
because these are automatically generated from the data we just we are going to link this in our detail later
10:49
first just that's fine we just keep it simple save now that's it so far we have not added any line of code
11:01
if you notice since the day one so F5 I'm going to run this application
11:10
I just simply hit F5 as soon as I hit F5 and I run my application you will see the user interface looks like
11:27
it coming up it loading it a little slow obviously so as you can see at the top of the bar
11:38
I see save and refresh two options in this menu right here task list that's where I have bunch
11:44
of items remember add author the screen we added right there so by default add author is selected
11:52
because there's only one screen we added and as soon as you click on add author you'll see it's
11:56
going to keep adding the author screens so let's close this for a second discard
12:01
discard here I'm going to type my name I'm going to what I'm doing right now is
12:08
actually I'm actually adding author data from here
12:26
If you, good thing, watch this
12:44
In photo, since it was an image type of column, as soon as you roll over, you will see upload
12:49
and close. So as soon as you click on this upload option you will see you can actually upload images right there. So look at my here are some authors from C sharp corner and I am going to select Mahesh from here
13:04
Now this is all my data and as soon as I say save voila data is already saved. Everything is saved now. Now I can add another author. I am going to say ok
14:28
oops I don't have proven photo but I'll just pick any so now as you can see if I click on these tabs
14:40
I can really browse through these authors so my data is added I can see display I can add it update them
14:49
and again you can also you know modify this in more details but this was pretty much
14:54
a quick overview of how powerful this new product can be how business guys who
15:03
don't even know ABC of code or even DBAs they can start building their own
15:09
application so I'm going to stop right here but in my next as soon as I learn
15:15
more I'm going to share more videos on this this new product
#Programming
#Software
#Windows & .NET