Click here to Skip to main content
15,913,055 members
Home / Discussions / C#
   

C#

 
AnswerRe: Create Playlist Pin
Rajesh Anuhya16-May-10 21:51
professionalRajesh Anuhya16-May-10 21:51 
GeneralRe: Create Playlist Pin
tanzeel8517-May-10 1:05
tanzeel8517-May-10 1:05 
GeneralRe: Create Playlist Pin
Eddy Vluggen17-May-10 2:46
professionalEddy Vluggen17-May-10 2:46 
AnswerRe: Create Playlist Pin
Henry Minute17-May-10 1:25
Henry Minute17-May-10 1:25 
QuestionHashtable and dictionary Pin
sujithkumarsl16-May-10 20:54
sujithkumarsl16-May-10 20:54 
AnswerRe: Hashtable and dictionary Pin
nagendrathecoder16-May-10 21:16
nagendrathecoder16-May-10 21:16 
GeneralRe: Hashtable and dictionary Pin
sujithkumarsl16-May-10 22:10
sujithkumarsl16-May-10 22:10 
GeneralRe: Hashtable and dictionary Pin
Eddy Vluggen16-May-10 23:39
professionalEddy Vluggen16-May-10 23:39 
GeneralRe: Hashtable and dictionary Pin
sujithkumarsl16-May-10 23:47
sujithkumarsl16-May-10 23:47 
GeneralRe: Hashtable and dictionary Pin
sujithkumarsl16-May-10 23:55
sujithkumarsl16-May-10 23:55 
GeneralRe: Hashtable and dictionary Pin
Eddy Vluggen17-May-10 0:01
professionalEddy Vluggen17-May-10 0:01 
GeneralRe: Hashtable and dictionary Pin
PIEBALDconsult17-May-10 3:31
mvePIEBALDconsult17-May-10 3:31 
GeneralRe: Hashtable and dictionary Pin
Eddy Vluggen17-May-10 3:56
professionalEddy Vluggen17-May-10 3:56 
GeneralRe: Hashtable and dictionary Pin
PIEBALDconsult17-May-10 4:24
mvePIEBALDconsult17-May-10 4:24 
QuestionC# version Pin
sujithkumarsl16-May-10 20:53
sujithkumarsl16-May-10 20:53 
AnswerRe: C# version Pin
nagendrathecoder16-May-10 21:11
nagendrathecoder16-May-10 21:11 
AnswerRe: C# version Pin
Abhinav S16-May-10 21:40
Abhinav S16-May-10 21:40 
GeneralRe: C# version Pin
sujithkumarsl16-May-10 22:08
sujithkumarsl16-May-10 22:08 
QuestionDataSets and DataAdapters Pin
USAFHokie8016-May-10 17:09
USAFHokie8016-May-10 17:09 
AnswerRe: DataSets and DataAdapters Pin
USAFHokie8016-May-10 22:09
USAFHokie8016-May-10 22:09 
QuestionGetting Database Names from Server MS SQL 2005 Pin
PDTUM16-May-10 11:20
PDTUM16-May-10 11:20 
Good Afternoon,

I posted this in General Databases earlier, but am not sure if is instead a C# problem since I am actually writing an application, so I am posting it here as well.

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 MS SQL 2005 Pin
Ravi Bhavnani16-May-10 13:25
professionalRavi Bhavnani16-May-10 13:25 
GeneralRe: Getting Database Names from Server MS SQL 2005 Pin
PDTUM16-May-10 15:14
PDTUM16-May-10 15:14 
AnswerRe: Getting Database Names from Server MS SQL 2005 Pin
Eddy Vluggen16-May-10 14:40
professionalEddy Vluggen16-May-10 14:40 
AnswerRe: Getting Database Names from Server MS SQL 2005 Pin
PDTUM16-May-10 15:07
PDTUM16-May-10 15:07 

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.