Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL
Well friends i created a commercial project with mdf files(Sql server 2008 files)
i installed two versions of vs (2010,2012). after installing vs 2012, i detached my mdf and added it to another project in vs 2010, but automatically (i don't know why!) my mdf file changed from sqlexpress to localdb\ version 11.0 and i had very big important data in it and now i can't use this mdf with SQL express 2008! what should i do? i don't know how to create install perquisite file for sql local db 2012. I don't know how to easily make a setup with vs 2012 but i knew how to do this with vs 2010, it was easy to install sql express with setup in vs 2010, but it is worst with instalshield!, can you please help me here, i'm stucked in the mud. i don't know what to do. should i remove my windows and install it again. cause i don't want sql server 2012!!!
Posted 15-Jan-13 10:51am
Edited 15-Jan-13 11:22am
v3
Comments
Sergey Alexandrovich Kryukov at 15-Jan-13 17:06pm
   
Rude. You should not right in this style, no matter how frustrated you are. And I already warned you for self-accepting some "answers". Please, keep to civilized or at least professional ways of doing things.
—SA
F.moghaddampoor at 15-Jan-13 17:11pm
   
Hello Dear Sergey
I didn't know the rules here!
Well i don't know you so much, but you may be a VIP.
How ever i should tell you sorry if i annoyed you, But my questions are really professionally asked and it seems awkward to just be punished for something like this, and well i accepted those answers cause they were right, i don't know why you are angry with me, pal, take it easy dear <3
OriginalGriff at 15-Jan-13 17:21pm
   
I have to agree with SA your language was indeed unprofessional and unnecessary. I do not think his tone was angry, it seemed informative and polite - certainly more polite than your original subject line.
Would you use such language in a business letter?
So why would you assume it to be professional to use it when addressing people you do not know, but want help from?
F.moghaddampoor at 15-Jan-13 17:24pm
   
Dear Original i may need some lessons from you, but really are we living in 2013. I'm pretty shocked here. How old are you pals? I'm 23.
OriginalGriff at 15-Jan-13 17:43pm
   
We are indeed living in 2013, but that doesn't mean that inappropriate swearing is either helpful or necessary. I would suspect that you did it either because you didn't think about it, or you wanted to stand out. But if SHOUTING is rude on the net (and netiquette says it is) then surely swearing is even more rude and liable to offend?
And you will definitely find huge numbers of people who will take serious offence to you SHOUTING at them!
 
Would you start a conversation with your doctor by swearing at him?
F.moghaddampoor at 15-Jan-13 17:49pm
   
Dear Original I won't do this again. I'm completely punished. Thanks you, I just lost very important data. I don't know what you mean here by netiquette, I didn't shout at pals, just express my feelings, I mean i didn't know alot about real life, I'm watching 24/7 series, Breaking bad, Dexter and so on. i got used to it. i admire your honesty, and i will regret for my shameful bad bad bad bad attitude toward real world.I love you all pal<3
OriginalGriff at 15-Jan-13 17:57pm
   
http://en.m.wikipedia.org/wiki/Etiquette_(technology)
jibesh at 15-Jan-13 17:26pm
   
right Agree with you both SA and Original. being around here nearly for an year you should be able to know how others use this forum and how to make a question.
F.moghaddampoor at 15-Jan-13 17:29pm
   
Dear I rarely come here, but i use my real name and you all using your second name, my English is not that well! Sorry to all of code project Members I'm very rude pals. God help me be polite.
OriginalGriff at 15-Jan-13 17:36pm
   
I use a user name that isn't my given name, yes. But if you check the published interview in my articles list, it gives my "real world" name.
I don't use it here because all the variants of it that didn't contain numbers were taken when I signed up.
F.moghaddampoor at 15-Jan-13 17:38pm
   
I know dear, you are my hero, but i just suggested that I'm just coming here rarely, i meant i used just my real name, i wasn't familiar with rules here, i respect them from now on pal.
OriginalGriff at 15-Jan-13 17:54pm
   
Totally off topic, two suggestions for you:
Don't use "dear" online. In the western world it is considered sexist and patronising, particularly if you are taking to a female - and you have no idea of anyone's real sex online!
Don't use "pal" on the end of a sentence either - it has connotations of aggression and can convert an innocent comment into an invitation to a fight in the pub car park. :laugh:
 
I know you aren't using either in that way, but it's best to avoid them.
F.moghaddampoor at 15-Jan-13 18:14pm
   
Oh very helpful dear, I'm not native, but didn't know this. so no to dear and no to pal at the end of sentences.
and of course don't use swear words at all.
Thank you very much.
OriginalGriff at 16-Jan-13 3:25am
   
You're welcome!
Sergey Alexandrovich Kryukov at 15-Jan-13 17:58pm
   
OK, let's draw a line here and forget about this little conflict.
 
Note that nick names are perfectly allowed. I use my real name though, but this is just my choice.
I removed your self-accepting "answers"; please be logical and don't do it. And, just logically, "Add your solution" is reserved to the cases when you try to provide some help, in response to some question in this forum. For everything else you can use "Improve question", a comment or reply to existing comment. I did not make a big deal out of it this time, but some heavier abusers already lost their memberships. You don't really want extra down-voted or abuse reports.
 
And, about wording style, we have heated discussions from time to time, but don't really use bad words, even with "......". This is not related to age at all, but not acceptable in some cultures. I'm more familiar with some Eastern cultures and know that for some this is a big sin. It's better to respect such limitations. If we limit our (unavoidable) judjment to knowledge, skills or understanding in purely technological and scientific areas, especially if there is something negative (also unavoidable sometimes), we keep staying on mutually respectable common ground.
 
Thank you for your understanding.
—SA
F.moghaddampoor at 15-Jan-13 18:07pm
   
Well, I understand what you say dear, Sergey you may know the eastern culture but I'm in them. I know them more than everything, cause i'm always researching on how to survive these countries. I mean sometime people are rude but they have kindness and <3 in their heart, but there are people seem very kind and you should trespass their beliefs and well you will be executed. you may be lucky to live in west. I will give my soul come out of here, and live with someone like you guys there in freedom where freedom is not restricted.
Pals I'm very thankful to have you around. This was a very moral conversation i didn't have for a year. I accept your territory from now on and will be the best friend of you from now on.
Sergey Alexandrovich Kryukov at 15-Jan-13 18:15pm
   
You are absolutely right here; I understand perfectly what you mean. I'm sure you will find good support here, your sincere talking and the very important ability to accept criticism in a constructive way should be honored.
Good luck,
—SA
F.moghaddampoor at 15-Jan-13 18:20pm
   
If this site has a like feature like Facebook i would like every comments of you, and i could give you my sincere intentions.
Sergey Alexandrovich Kryukov at 15-Jan-13 18:27pm
   
Thank you. Many already did :-) "Like" are only on questions/answers/articles and other posts like that... Votes 1 (very bad) to 5 (excellent)...
—SA
jibesh at 15-Jan-13 18:02pm
   
Got a hint just check your PC has system restore point enabled if yes restore your computer to the previous date you may have a chance to get it back. its purely based on how you set the restore points earlier.
F.moghaddampoor at 15-Jan-13 18:11pm
   
Thank you jibesh i will try :)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I find my answer:
first we create an exe file that installs sql server local db 2012. because its indeed small size rather than sql server 2008.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.IO;
using System.Configuration.Install;
using System.Diagnostics;
 
namespace EXE
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            bool instalResult = false;
            timer1.Enabled = true;
            string strResult = "n";
            strResult=fncCheckRegistry();
            bool is64 = CheckCpuArcitecture();
            string appPath = Path.GetDirectoryName(Application.ExecutablePath);
            string strMsix86FileName = appPath + @"\x86\SqlLocaLDB.msi";
            string strMsix64FileName = appPath + @"\x64\SqlLocalDB_64.msi";
            //

            if (strResult != "y")
            {
                if (is64 == false)
                {
                    instalResult=fncInstal32(strMsix86FileName);
                }
            }
            if (strResult != "y")
            {
                if (is64 == true)
                {
                    instalResult = fncInstal32(strMsix64FileName);
                }
            }
            if (instalResult) timer1.Enabled = false;
            this.Close();
        }
        //
        public bool fncInstal32(string sMSIPath)
        {
            try
            {
                Console.WriteLine("Starting to install application");
                Process process = new Process();
                process.StartInfo.FileName = "msiexec.exe";
                process.StartInfo.Arguments = string.Format(" /qf /i \"{0}\" ALLUSERS=1  IACCEPTSQLNCLILICENSETERMS=YES", sMSIPath);
                process.Start();
                process.WaitForExit();
                Console.WriteLine("Application installed successfully!");
                return true; //Return True if process ended successfully
            }
            catch
            {
                Console.WriteLine("There was a problem installing the application!");
                return false;  //Return False if process ended unsuccessfully
            }
        }
        public bool CheckCpuArcitecture()
        {
            bool is64 = System.Environment.Is64BitOperatingSystem;
            return is64;
        }
        //
        public string fncCheckRegistry()
        {
            string strResult = "n";
 
            using (RegistryKey Key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server 2012 Redist\MSSQL11E.LOCALDB\1033\CurrentVersion"))
                if (Key != null)
                {
 
                    strResult= "y";
                }
                else
                {
                    strResult= "n";
                }
 
            return strResult;
        }
        bool x = false;
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (progressBar1.Value==100) x=true;
            if(!x) progressBar1.Value++;
            if (progressBar1.Value==0) x=false;
            if(x) progressBar1.Value--;
        }
    }
}
This checks cpu Arcitecture and if my msi is installed before.
the problem begins here.
I used this project as an exe in custom actions in a another setup project.
in the second setup project i install .net framework 4 and windows installer.
but i added custom action in the commit part of the setup.
So after the first installation finished(not completely the finish button is not clicked) the second setup that install sql server will begin, but how unlucky i am after two days of thinking on my problem it warns me about having two setup working together!!!
What should i do friends? do you have any suggestion?
How can i close the base uninstaller at the end of installation and open another process?
wow i find the answer her too:
I have find my answer:

Well we create an installer class and we write this in it:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
 
namespace OpenWeb
{
    [RunInstaller(true)]
 
    public partial class Installer1 : System.Configuration.Install.Installer
    {
        [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
        public override void Install(IDictionary stateSaver)
        {
            base.Install(stateSaver);
        }
 
        [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
        public override void Commit(IDictionary savedState)
        {
            base.Commit(savedState);
            System.Diagnostics.Process.Start(Context.Parameters["TARGETDIR"].ToString() + "Exe.exe");
            // Very important! Removes all those nasty temp files.
            base.Dispose();
        }
 
        [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
        public override void Rollback(IDictionary savedState)
        {
            base.Rollback(savedState);
        }
 
        [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
        public override void Uninstall(IDictionary savedState)
        {
            base.Uninstall(savedState);
        }
 
        public Installer1()
        {
            InitializeComponent();
        }
    }
}
then we create our setup and we add our exe file and we add the installer class by adding primary output.
now we add custom action in commit and install by adding primary output there too.
now we build our setup.
Enjoy
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 6,656
1 Sergey Alexandrovich Kryukov 6,490
2 CPallini 5,310
3 George Jonsson 3,584
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web04 | 2.8.140921.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100