Solved

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

Posted on 2016-11-08
5
101 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 28

Expert Comment

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

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 28

Assisted Solution

by:Pawan Kumar
Pawan Kumar 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

831 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