Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I'm building a windows form application wherein it there is a 2 external Query and wanna when I click on my WinApp Button1 execute and create new database and then when i click on Button2 an other Query alter that database like (insert, Update,Delete)
without opening MS SQL
I try every thing , even try batch file to run Queries but without opening MS SQL Server, Unfortunately nothing happened!
Help me.
Thanks.
Posted
Updated 26-Oct-14 11:48am
v2
Comments
Maciej Los 26-Oct-14 17:47pm    
What you mean by: "try batch file to run Queries but whiteout opening MS SQL Server"?
CHill60 26-Oct-14 17:49pm    
Post the code you tried
[no name] 26-Oct-14 20:33pm    
Why on earth are you opening MySQL Server which is the application engine for handling your queries. It is not for anything else; begs the question, what is it you are trying to achieve in a C# Application that requires queries without a connection to the server? Which might I add is theoretically impossible as far as my knowledge goes on SQL and MySQL Engines...

If what you are after is creating an application with an embedded database [^] that does not use SQL: try SQLLite: [^].
"SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain."
There is one .NET implementation of SQLLite here: [^]; another one (ADO.NET provider) here [^]; another one here [^].

Search CodeProject for "SQLLite" articles, and you'll find tutorials for using these.
 
Share this answer
 
Comments
Maciej Los 27-Oct-14 2:54am    
Interesting alternative ;)
mehdiMj.ir 27-Oct-14 4:38am    
First , I wanted to create an executable file from Sql and When i click on it show all fields in my database or when i click on an other Query alter my database .
by saying "do not open ms sql server" i mean :
without any SQl Server or Servises so I serach and found SQL Compact Edition but still I should make a conection and other setting
by the way i did notknow that SQLlite works in C# , Thought that just for smart phone or some thing
thanks for All your answers and comments
Please, read my comment.

If by saying "open ms sql server" you mean open MS SQL Server Management Studio, you're wrong. When you're database programmer, you need to know that to be able to create new database and make CRUD operations[^] on it, you need to connect to sql server[^]. You don't have to open ms sql server, because it's already running (it's windows service and starts when Windows operating system starts).

The connection to ms sql server is possible via SqlClient[^] objects and methods. Some instructions, like create database would be possible to execute only in case when you have admin privileges.
 
Share this answer
 
Comments
[no name] 26-Oct-14 20:29pm    
@Maciej, I think your solution is more of a remark than a solution as the question is theoretically stupid and makes no sense, or is very badly worded. As a result; I won't even downvote you, but suggest you put this in a comment before someone else -25 your reputation. ;)
BillWoodruff 26-Oct-14 21:49pm    
You'll see lots of solutions here where the poster has made a reasonable attempt to answer the probable question asked where the question doesn't quite make sense, or is muddled, confused, written in awkward English, etc. People like Maciej, and OriginalGriff, have lots of experience interpreting the questions.
[no name] 26-Oct-14 21:58pm    
Thanks Bill, I will keep that in mind when attempting to answer in solutions rather than comments. No offense intended Maciej. It's just how it reads my friend...
Maciej Los 27-Oct-14 2:53am    
From time to time we can only guess what OP wants to achieve, especially when the question is too vague to answer it directly. So, this soltion is indirect answer to OP's question ;)
Thank you, CodingK for your valuable comments ;)
Maciej Los 27-Oct-14 2:49am    
My intuition fails me sometimes...
Thank you, Bill for your support ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900