nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   Software Development (http://www.nvnews.net/vbulletin/forumdisplay.php?f=53)
-   -   Visual Studio (http://www.nvnews.net/vbulletin/showthread.php?t=130475)

ctemes 03-22-09 06:17 PM

Visual Studio
Two questions:
1. How can I execute a SQL statement in a windows project (the database i attached to the project).
2. How do I make windows MDI children of an MDI main form?

Zhivago 03-22-09 06:51 PM

Re: Visual Studio
I don't know exactly what it means to "attach" a database to a project, but the idiom is to establish a connection to the db and then build up and execute your query, and then process the result set. I believe Microsoft offers ADO for that sort of thing.

yehuda 03-23-09 08:58 AM

Re: Visual Studio
You should really use entities framework or Linq to SQL if you develop for .net 3.5 (and maybe WPF while you're at it).

If not, I believe there is a designer where you can input SQL and execute it.
It's been a long time since I made windows forms and ado.net projects though.

ViN86 03-30-09 06:17 PM

Re: Visual Studio
in order to execute SQL statements you need to use one of two things.

you either need to use a reference to a .dll file for databases such as MySQL or something similar, or you can use MS's builtin ADO statements.


ADO is very easy to use. i have also used the MySQL extension and that is very easy as well. you just need to have the MySQL service running.

thor1182 04-03-09 10:52 AM

Re: Visual Studio

_Login = new LogIn();
            _Login.MdiParent = this;
            _Login.WindowState = FormWindowState.Maximized;
            _Login.UserLogIn += this.LogUserIn;
  if (ActiveMdiChild != _LuaFinder)
                if (ActiveMdiChild != null)

I think is something close to what you are looking for the midi stuff. Thats with 3.5, and I don't know how different it is in the older frameworks (and I don't know if what I am doing is "correct", but it works).

Also if you are using 3.5, open up google and look up LINQ, do not pass go, do not collect $200. When you generate your DataContext object it should auto create the connection string for you.

All times are GMT -5. The time now is 02:37 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.