|
-
Jan 16th, 2006, 11:43 AM
#1
Thread Starter
Hyperactive Member
I am just FULL of SQL questions...
This is mainly an ADO.NET 2.0 question.
If you create a new dataset, then add a table ot it with a name and whatnot, can it automatically create the table with the columns, sizes, stipulations, etc in SQL server or would you need to do that in an SQLCommand?
Thanks for the help!
Currently Using: VS 2005 Professional
-
Jan 16th, 2006, 12:05 PM
#2
Re: I am just FULL of SQL questions...
No, it does not automaticaly do that. You would have to create the table yourself using a CREATE TABLE script.
-tg
-
Jan 16th, 2006, 12:53 PM
#3
Thread Starter
Hyperactive Member
Re: I am just FULL of SQL questions...
How do I programmatically, through VB.net 2k5, create a relationship? I have 2 tables, one with 3 fields. Thos fields' values are dependant on a few records from the 2nd table. If I update the values in the second table, is there a way to have it update the dependant fields from the first table?
Thanks.
Currently Using: VS 2005 Professional
-
Jan 16th, 2006, 01:03 PM
#4
Re: I am just FULL of SQL questions...
I cannot remember if it is video 8 or 9, but one of them does a good job of walking you through establishing relationships between two tables.
http://msdn.microsoft.com/vstudio/express/vb/learning/
"Imagination is more important than knowledge..."
Albert Einstein
-----------------------------------------------
If my reply helped you then you really were lost, but I still took the time to help, please rate it anyway
-
Jan 16th, 2006, 02:38 PM
#5
Thread Starter
Hyperactive Member
Re: I am just FULL of SQL questions...
Is there a way to fill a dataset with the entire database?
Currently Using: VS 2005 Professional
-
Jan 16th, 2006, 07:09 PM
#6
Re: I am just FULL of SQL questions...
 Originally Posted by tacoman667
Is there a way to fill a dataset with the entire database?
The best way to do that would be to create a strongly-typed DataSet and then Fill from each TableAdapter. I haven't had the pleasure in 2.0 yet so I don't know all the ins and outs I'm afraid. I think you have to add a data source to your project, which creates a DataSet type that has the same schema as your database. You can then create instances of this DataSet and populate its tables using the automatically generated TableAdapters.
-
Jan 17th, 2006, 12:32 PM
#7
Thread Starter
Hyperactive Member
Re: I am just FULL of SQL questions...
Whew, that sounds like alot of work, especially considering that my database must stay as dynamic as possible. I wish I could just use the databinding objects generated by VS2k5 but I am constantly creating new databases and tables within that DB.
A question I just thought about, how would I go about presenting a list of all databases within the SQL server?
I was thinking of putting it on a treeview or listview for the user to click and open the DB.
Thanks for the help!
Currently Using: VS 2005 Professional
-
Jan 17th, 2006, 12:54 PM
#8
Thread Starter
Hyperactive Member
Re: I am just FULL of SQL questions...
AHA! I figured it out. You can write a SELECT statement to get the list.
[Highlight=VB]
SELECT * FROM sys.databases
[\VBCODE]
Currently Using: VS 2005 Professional
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|