Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to run sql script included in application

Posted on 2015-02-14
4
Medium Priority
?
45 Views
Last Modified: 2015-02-14
I  have  four scripts  ,which I  use  to  deploy  along  with  my  exe  at  client  end.Scripts  use to create  database.
Now  it is  requirement  that,sepearate  script  files  should  not  be there.So  I  included  them  in  WPF  C#  application.
Now  I  have  to  give  path  of   them.How  can give  script  files  path  from  application.I  am  attaching  image  of  my  folder  structure.I  need  to  run script  from  project LumiQuant_ASW. Please  help
SQL-script.png
SQL-script2.png
0
Comment
Question by:ADITYA RAO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
4 Comments
 

Accepted Solution

by:
ADITYA RAO earned 0 total points
ID: 40609579
I  moved  file  to LumiQuant_ASW and  in  I  appended  path
 String strpath = AppDomain.CurrentDomain.BaseDirectory;
It  worked  perfectly
0
 

Author Comment

by:ADITYA RAO
ID: 40609583
very  sorry  to  inform  this  solution  does  not  work. I  found  no  option  to  reopen  the  question.
Actually  solution  runned  once  because  by  mistake  script  files  where  present in  debug  folder.
The  main  question  how  to  use  files  in  application  and  not  on  physical  drive.Please  reopen
the question.
0
 

Author Comment

by:ADITYA RAO
ID: 40609629
Now I  found  perfect  solution  which  worked.
I  renamed  .sql files  to .txt
Added those  files in project.
right clicked  files and opened properites,set  build action to"Embeded Resources"


  Assembly _assembly;
  _assembly = Assembly.GetExecutingAssembly();
 _assembly.GetManifestResourceStream("PrjMerilDB.CREATEDB_ELISALUMI.txt")
0
 

Author Comment

by:ADITYA RAO
ID: 40609630
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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