Show a few Tables from a Database - c#

im working with mysql and I have to show only a few taenter image description herebles in a combobox, I'm using SHOW TABLES FROM DATABASE, but when I want to filter that I use SHOW TABLES FROM DATABASE LIKE '% example %' the problem is I dont know if I can do NOT LIKE (this will be more easy) because the tables have a lot of names.
There are like 30 or more tables. I'm working with mysql on c#. Also in asp.net
Thank you for the help!
I expect show only the tables that I want

Related

Create and store database locally with asp.net

I have a small website with couple different forms inserting data to sql. But the users have problem with it. The problem is that they seem to be going through them too fast that its not recording everything.
So i am trying to see if there was a way to store all the data locally and have it insert to sql at the end when they are done filling out forms. Is this possible?
For example:
I have a form that have 5 fields but 2 are auto populated and 1 entered manually and 2 are being inserted using bar code scanner. The bar code scanner is the last value required before being inserted, so i was hoping there was a way to insert that into locally store access database (not seen by anyone) and when they press "Finish" all that data from access will be inserted into sql.
Hope i painted the picture clear enough.
Let me know any and all possibilities.
EDIT: Here is the aspx and .cs, hope this helps. Yes i realize that i have validation for the bar code, but not sure why its slow. And i may have stuff cluttered. So please bear with me.
Sounds like you need to put that data in application session or cache and then flush the data to db.
Here are some other choices though:
Flat files (simply serialize your objects, use protobuf)
Use Embeded Db: SqlLite, VistaDb, Sql Server Compact...
Store data in the browser via localstorage (dom storage, this is html 5 feature)

Display Table Data to the user in Visual Studio 2010

Because nobody answered to my previous questions I need to find a different solution.
So, if you can please help me I would appreciate it very much.
I need to present to the user that use the app some table data by his name and id.
In other words I have a table data about flights reservations that the user performed earlier.
that table contains flight reservations of all the users.
now I want that in case the user entered his user name and id I will show him all the data from the table that the columns userName and idNumber equals to his personal details.
How can I do this?
Where's the data coming from? If you're using a database, then databinding is going to be the simplest method of doing this. There are a ton of examples of databinding to a SQL database around the web. Here's one.
For showing only the selected user's data, you would add filters to the query appropriately. You can also search Google for ASP.net data binding and get a lot of examples.

How can i fetch Database column names and how can i manage it

Problem:
SQL Server table is vertical grid with options, i want the same thing to be done in asp.net with c#,
i want to connect the system with the table, it will fetch table column names with check boxes on front, and when we would check or uncheck, the value would be stored in sql server table, as we edit using SQL Server management studio, i want the same component vertically integrated into my web application. Please let me know, can we use grid vertically or there is some control for this?
You will have to iterate through the properties of the table you want. Display this information in a format that you like, and then write various small queries to edit whatever you want to be editable.
http://www.codeproject.com/KB/database/DatabaseSpy_CS.aspx
http://www.sqlrecipes.com/sql_questions_answers/how_get_table_structure_via_sql-92
http://www.google.com/search?ie=UTF-8&q=SQL+Table+Structure+c%23

DataGridView population+modificaion by SQL Server DB View

I searched StackOverFlow.com for my issue, but could not find any similar/related solution.
I have few tables in SQL Server 2005, and have to make use of those tables in my Winform/C# application which is supposed to be an Admin Application where the Administrator will:-
1.Add/Edit users
2.Assign Roles
3.Assign Privileges
4.Zone Assignment
5.Area Assignment
6.Town Assignment
The result of each of these is coming from a minimum of two tables(of SQL Server DB), and this result has to be populated in each individual DataGridView of a TabControl's each TabPage.
The Administrator will first see the results, and then he/she can modify the values via the SelectedRow of the DataGridView, and in response this modification will be updated in the Database(i.e. SQL Server).
Since I am new to programming, my question is that I want to use an
SQL Server View, to get all this stuff done, but haven't used the View in connection to the DataGridView.
Although I am able to populate the single DataGridView from the SQLServer Binded DataSource, but this works only for a single DataGridView, I need to have the data for all the concerned DataGridViews in a single step.
Can anybody tell me how to do this?
If there is any other efficient solution to this, kindly reply.
NOTE:I am using Microsoft Enterprise Library, so would not use any In-Line SQL Queries.
For reference I am attaching the following link with Images.
link text
From what I remember, your Binded DataSource has to be from a single table in SQL. Have you tried representing the data differently? A drill-down to related data instead of showing it all in the same dataset would be your best solution.

select a database and in that select tables. using c# . use web config

Im using c# .net windows form application.
I have many databases created using sql server Management studio 2005. Each database has several tables. i have a button, when clicked should allow me to select a database among several databases and in that database i want to select a single table. Later i need to display the contents of the selected table into a datagrid view.I came to know that it can be done using Webconfig. How can i acheive this?
It goes like this
a) select a database
b) In that database select a table
c) display the contents into a datagridview.
You got some things mixed up a bit. A web.config file is only used for web applications created with ASP.Net.
For windows application you can use the App.config file, which is like the web.config for web applications. As part of the app.config is the "connectionStrings" section which contains one or multiple connection string for database connections. Take a look at this page:
http://msdn.microsoft.com/en-us/library/ms254494%28VS.80%29.aspx
In code you then can retrieve the connections string via the ConfigurationManager.ConnectionStrings properties.
It is called "programming". Good enough an answer? I mean, you basically ask a LOT ;)
Ok, here some details:
You need to log into the server, obviously.
Then find out what databases exist. MASTER database is your friend - look at the sys schema there, you will find out the tables there contain all information.
Then you need to find out what tales exist. The INFORMATION_SCHEMA is your friend. It exists in every database. It has nice views that allow you to ask for tables, columns etc.
From there on it is some low level beginner training - given a database and table name, how do you get the data? ;)

Categories