Solved

Visual Studio Front End "Web Forms" For SQL Server Tables

Posted on 2016-11-08
5
45 Views
Last Modified: 2016-11-14
Hi Experts,

Is there a ready-made Visual Studio Front End "Web Forms" For SQL Server Tables, that I can use to present my database tables to end user, so he can "view, edit and delete" similar to MS Access forms?

Thanks a lot.
Harreni
0
Comment
Question by:Harreni
5 Comments
 
LVL 18

Expert Comment

by:Pawan Kumar Khowal
ID: 41879935
I think no, there is not a ready made thing in c# for this.
0
 
LVL 45

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 125 total points
ID: 41880029
In Visual Studio you don't work with predefined forms but you have plenty of objects.
For what you want you can check for DataGridView. It's an object that you can add to a form and bind it to a database table. You might to add some code but after you get used to it you can have almost the same with an Access form with some minutes work.
You may try to google for similar objects from 3rd parties companies. Some are free.
0
 
LVL 18

Assisted Solution

by:Pawan Kumar Khowal
Pawan Kumar Khowal earned 125 total points
ID: 41880044
Are you working on Windows or web? In any case you have to create you own form and create a connection with the db using ADO.NET to perform DB operations.
0
 
LVL 12

Accepted Solution

by:
Dustin Saunders earned 250 total points
ID: 41880976
Maybe I'm not understanding what you need, but Visual Studio is the form builder.  You use it just like Access to make the form layouts with text boxes, labels, combo boxes, (etc.)  But you will need to write the code for the connections that Access 'automates' for you.  

For example, to get the selection results from a SQL query to put into a data table as suggested you'd need some code similar to this:
public static DataTable GetSelectResults(string sqlQuery, DataTable parameters = null)
        {
            //Build a new datatable with the results from our SQL query.
            DataTable dT = new DataTable();
            string cs = GetConnectionString();
            using (SqlConnection _cs = new SqlConnection(cs))
            {
                _cs.Open();
                SqlCommand cmd = new SqlCommand(sqlQuery, _cs);
                //Add parameters if exist
                PutParameters(cmd, parameters);

                SqlDataAdapter dA = new SqlDataAdapter(cmd);
                dA.Fill(dT);
            }
            return dT;
        }

Open in new window


Then you would need to bind that Data Table to the DataGridView.

But, you would also need to write the code back to the SQL database, it's not a 'linked table' like how Access functions- until you code it that way.
0
 

Author Closing Comment

by:Harreni
ID: 41887346
Thanks a lot experts for these nice explanations.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now