Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error Icomparer interface - To sort FileInfo Pin
AspDotNetDev21-May-10 15:39
protectorAspDotNetDev21-May-10 15:39 
GeneralRe: Error Icomparer interface - To sort FileInfo Pin
quanvt21-May-10 17:43
quanvt21-May-10 17:43 
Question.TableName, why use that? Pin
mprice21421-May-10 11:10
mprice21421-May-10 11:10 
AnswerRe: .TableName, why use that? Pin
Pete O'Hanlon21-May-10 12:29
mvePete O'Hanlon21-May-10 12:29 
AnswerRe: .TableName, why use that? Pin
PIEBALDconsult21-May-10 14:29
mvePIEBALDconsult21-May-10 14:29 
GeneralRe: .TableName, why use that? Pin
mprice21421-May-10 14:53
mprice21421-May-10 14:53 
GeneralRe: .TableName, why use that? Pin
PIEBALDconsult21-May-10 15:21
mvePIEBALDconsult21-May-10 15:21 
GeneralRe: .TableName, why use that? Pin
mprice21422-May-10 4:00
mprice21422-May-10 4:00 
PIEBALDconsult wrote:
Try it.


Yes, I knew this would be coming. One can certainly add a table to either a collection or use it in a method without having a formal name (but I don't think that is what you meant, is it)

public class Tables
    {
        public DataTable tblTest1;
        public DataTable tblTest2;
        public DataSet dsTables;

        public Tables()
        {
            dsTables = new DataSet();
            tblTest1 = new DataTable();
            tblTest2 = new DataTable();
            dsTables.Tables.Add(tblTest1);
            dsTables.Tables.Add(tblTest2);
                        
        }

        public void ShowTables()
        {
            DataTableCollection tables = this.dsTables.Tables;

            foreach (DataTable tbl in tables)
                Console.WriteLine(tables.IndexOf(tbl).ToString());
        }
    }

    public static class Program
    {
        static int Main(string[] args)
        {
            Tables coll = new Tables();

            coll.ShowTables();
            Console.WriteLine();
            Console.ReadLine();
            return 0;
        }
    }


granted, having the foreach execute on

Console.WriteLine(tbl.TableName);


seems a bit more useful at first glance, so I guess I have my answer.........
QuestionSingle Sign On question Pin
Etienne_12321-May-10 10:56
Etienne_12321-May-10 10:56 
AnswerRe: Single Sign On question Pin
Pete O'Hanlon21-May-10 12:24
mvePete O'Hanlon21-May-10 12:24 
GeneralRe: Single Sign On question Pin
Etienne_12321-May-10 13:00
Etienne_12321-May-10 13:00 
GeneralRe: Single Sign On question Pin
Pete O'Hanlon21-May-10 23:49
mvePete O'Hanlon21-May-10 23:49 
GeneralRe: Single Sign On question Pin
Etienne_12324-Jun-10 1:38
Etienne_12324-Jun-10 1:38 
GeneralRe: Single Sign On question Pin
Etienne_12315-Jul-10 23:50
Etienne_12315-Jul-10 23:50 
QuestionPurpose of Web Service Namespaces Pin
AspDotNetDev21-May-10 10:29
protectorAspDotNetDev21-May-10 10:29 
AnswerRe: Purpose of Web Service Namespaces Pin
Pete O'Hanlon21-May-10 12:34
mvePete O'Hanlon21-May-10 12:34 
GeneralRe: Purpose of Web Service Namespaces Pin
AspDotNetDev21-May-10 12:40
protectorAspDotNetDev21-May-10 12:40 
AnswerRe: Purpose of Web Service Namespaces Pin
Jürgen Röhr22-May-10 1:42
professionalJürgen Röhr22-May-10 1:42 
QuestionHow to work on VOIP, Video Conferencing, Chat room using either intranet or internet system Pin
CoderForEver21-May-10 9:02
CoderForEver21-May-10 9:02 
QuestionDatabase Query Error: {"Must declare the scalar variable \"@UserId\"."}...has me baffled Pin
PDTUM21-May-10 8:13
PDTUM21-May-10 8:13 
AnswerRe: Database Query Error: {"Must declare the scalar variable \"@UserId\"."}...has me baffled Pin
William Winner21-May-10 8:21
William Winner21-May-10 8:21 
AnswerRe: Database Query Error: {"Must declare the scalar variable \"@UserId\"."}...has me baffled Pin
PDTUM21-May-10 9:17
PDTUM21-May-10 9:17 
AnswerRe: Database Query Error: {"Must declare the scalar variable \"@UserId\"."}...has me baffled Pin
Dimitri Witkowski21-May-10 8:22
Dimitri Witkowski21-May-10 8:22 
AnswerRe: Database Query Error: {"Must declare the scalar variable \"@UserId\"."}...has me baffled Pin
PDTUM21-May-10 9:12
PDTUM21-May-10 9:12 
Questionreference can't be found works while in visual studio, but not outside Pin
aei_totten21-May-10 8:07
aei_totten21-May-10 8: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.