Click here to Skip to main content
15,921,622 members
Home / Discussions / Database
   

Database

 
GeneralRe: Database Size Issues Pin
loyal ginger17-May-10 14:10
loyal ginger17-May-10 14:10 
AnswerRe: Database Size Issues Pin
David Mujica17-May-10 3:17
David Mujica17-May-10 3:17 
GeneralRe: Database Size Issues Pin
Ed Hill _5_17-May-10 10:27
Ed Hill _5_17-May-10 10:27 
AnswerRe: Database Size Issues Pin
The Man from U.N.C.L.E.17-May-10 3:50
The Man from U.N.C.L.E.17-May-10 3:50 
QuestionGeneric database system Pin
vjvjvjvj16-May-10 22:32
vjvjvjvj16-May-10 22:32 
AnswerRe: Generic database system Pin
R. Giskard Reventlov16-May-10 23:03
R. Giskard Reventlov16-May-10 23:03 
AnswerRe: Generic database system Pin
PIEBALDconsult18-May-10 5:35
mvePIEBALDconsult18-May-10 5:35 
QuestionGetting Database Names from Server Pin
PDTUM16-May-10 10:47
PDTUM16-May-10 10:47 
Good Afternoon,

I used a nice SQL insert/update program for years with MSSQL 2000, but was never able to get it past security to make it work with 2005. This weekend, out of frustration, I decided to take a shot at writing one of my own. In doing so, I attempted to list the databases that were on the server. I first tested the command in the Query analyzer and it worked fine, returning all the names of the databases. However, when I tried to use the exact same code in the application, every database name comes up as "master" in the array, so I cannot continue to propagate the tables without a named database. I cannot understand how the identical code can return different results in different places. Here is the code.
Appreciate your assistance....Thank you, Pat

string Sql = "SELECT name FROM sys.databases";

                SqlCommand Comm = new SqlCommand(Sql, Conn);

                SqlDataAdapter da = new SqlDataAdapter(Comm);
                DataSet ds = new DataSet();
                da.Fill(ds);
                
		int cnt = ds.Tables[0].Rows.Count;
                string[] dbs = new string[cnt];

                for(int i = 0; i < cnt; i++)
                {
                 dbs[i] = ds.Tables[0].Rows[0]["name"].ToString();   
                }
 
                foreach(string s in dbs)
                {
                    databases.Items.Add(s);
                }

AnswerRe: Getting Database Names from Server Pin
Eddy Vluggen16-May-10 14:41
professionalEddy Vluggen16-May-10 14:41 
QuestionUsing access to find the most of records Pin
Dave McCool16-May-10 6:56
Dave McCool16-May-10 6:56 
AnswerRe: Using access to find the most of records Pin
riced16-May-10 8:29
riced16-May-10 8:29 
GeneralRe: Using access to find the most of records Pin
Luc Pattyn16-May-10 8:32
sitebuilderLuc Pattyn16-May-10 8:32 
GeneralRe: Using access to find the most of records Pin
Dave McCool24-Jun-10 5:01
Dave McCool24-Jun-10 5:01 
QuestionSQL COMPACT VERSION Pin
Pranay Rana15-May-10 17:45
professionalPranay Rana15-May-10 17:45 
AnswerRe: SQL COMPACT VERSION Pin
Andy_L_J15-May-10 18:44
Andy_L_J15-May-10 18:44 
AnswerRe: SQL COMPACT VERSION Pin
CitrusTech15-May-10 22:08
CitrusTech15-May-10 22:08 
Questionmultiple threads [modified] Pin
Jack_1815-May-10 15:39
Jack_1815-May-10 15:39 
AnswerRe: multiple threads Pin
loyal ginger15-May-10 17:24
loyal ginger15-May-10 17:24 
GeneralRe: multiple threads Pin
Jack_1816-May-10 1:47
Jack_1816-May-10 1:47 
GeneralRe: multiple threads Pin
loyal ginger16-May-10 14:48
loyal ginger16-May-10 14:48 
AnswerRe: multiple threads Pin
Luc Pattyn16-May-10 2:41
sitebuilderLuc Pattyn16-May-10 2:41 
GeneralRe: multiple threads Pin
Jack_1816-May-10 5:29
Jack_1816-May-10 5:29 
GeneralRe: multiple threads Pin
Luc Pattyn16-May-10 5:41
sitebuilderLuc Pattyn16-May-10 5:41 
GeneralRe: multiple threads Pin
Eddy Vluggen16-May-10 6:06
professionalEddy Vluggen16-May-10 6:06 
AnswerRe: multiple threads Pin
Henry Minute17-May-10 3:19
Henry Minute17-May-10 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.