index > .NET Framework Data Access and Storage > Generating sql query using C# code

Generating sql query using C# code

How do i generate sql query using my frontend windows application C# 2005. ie developer has to select table and columns from the list box. it should look like our add query in the sql express 2005.

Thanks

Arun

Arun S

Hi,

I guess you'll have to manually create your own sql query string. Unless you are willing to use 3rd party software that automatically generates sql statements. Although these query generator has its own UI.

cheers,

Paul June A. Domag




Visit my Online Blog - http://webmag.mvps.org
Paul Domag

Thanks Paul June A. Domag

Exectly you are correct. but i want some sample code. could you pls help in this case.

Thanks

Arun

Arun S

hi,

If you want to do programming by your self, you have to consider check the information_schema view to get information about SqlServer schema.

You can pick up from that view the tables contained in the DB, the fields and characteristics of the fields of a specific table, etc.

check this link if you are interested on using this view

Sql Schema

Hope this helps!

Diego Rojas

Excelsus

 

 




Diego Rojas.
Luis D. Rojas
reply 4

You can use google to search for other answers

 

More Articles

• Microsoft.ApplicationBlocks.Data.SqlHelper.cs
• Error in dataAdapter.Fill
• ComboBox, CheckBox in bound forms
• DataGridViewCellStyle Editor
• Using classic ADO parameter objects from VC#2005
• Com Exception is unhandeled while executing ExecuteReader
• Access to SQL Database via TCP/IP
• delete and update code at the same button cause concurrency viola...
• Help: UInt32 vs Int32 as foreign and primary keys, DataError in D...
• DataAdapter inserting values into the database, dataset not havin...
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• mapping issue in ado.net when executeNon
• The provider could not determine the Dec
• Mysql connection
• What is the List<OdbcParameter>.En
• Query about DataSet
• OledbConnection and DSN
• How can I save textbox with value in the
• Update Statement - Syntax Problem
• Error when failing over to mirrored data
• To clean pool of connections in ADO.NET
• How to save Access Query Data after user
• ExecuteReader requires an open and avail
• Use of Transactions for long slow proces
• OnTableNewRow for a derived DataTable do
• informix: exist a wizard to create datas

Hot Articles

• DataTable - Null Object Reference Error
• connection and fucntions
• Combo Boxes and RecordSet
• Save data as xml file
• Urgent! Pls answer me. Database.
• Enterprise Library problem with oracle 1
• access sql server database with vb
• Error in executing parameterised query
• Problem with Transactions C# and Sql Exp
• Isolation.ReadUnCommitted Locking Proble
• Update without Parameter
• Populate DataSet from CSV
• SqlConnection Problem
• convert database to xml
• Memory Efficiency of DataTables

Recommend Articles

• Merging two datatables with different co
• data extraction from PBXs
• How to schedule a windows service for ev
• Add rows to DataTable
• Can I open an Access database from vb .n
• Determine Primary Keys using SqlConnecti
• Datasets and SQL Server
• Can't connect to database from web servi
• Help with MS Access SQL Query
• How to perform a case insensitive filter
• Using diffgram to update database
• OnTableNewRow for a derived DataTable do
• Getting deleted child rows for a "S
• retrieve schema info for a SQL statement
• import / parse DIF files (Data Interchan