Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: comparing ascii values Pin
Simon P Stevens17-Nov-08 22:43
Simon P Stevens17-Nov-08 22:43 
GeneralRe: comparing ascii values Pin
Guffa17-Nov-08 23:47
Guffa17-Nov-08 23:47 
GeneralRe: comparing ascii values Pin
Simon P Stevens18-Nov-08 0:10
Simon P Stevens18-Nov-08 0:10 
AnswerRe: comparing ascii values Pin
Guffa17-Nov-08 22:27
Guffa17-Nov-08 22:27 
GeneralRe: comparing ascii values Pin
Pedram Behroozi17-Nov-08 22:40
Pedram Behroozi17-Nov-08 22:40 
GeneralRe: comparing ascii values Pin
Guffa17-Nov-08 23:38
Guffa17-Nov-08 23:38 
QuestionMQ Submission from Web Application Pin
a115947617-Nov-08 21:21
a115947617-Nov-08 21:21 
QuestionADO.net not unqiue column names Pin
BlaiN17-Nov-08 20:47
BlaiN17-Nov-08 20:47 
Hello

I'm using the Fill-Method of the SqlDataAdapter. If i'm having two or more columns with the same name, the Adapter adds a numeric suffix to the name. I can't change the SQL's. I know it's not nice...

If i'm having more than one column with the same name, i want to access the last column with the original name.

Here a sample:

string connectionString = string.Format("Data Source={0};Initial Catalog={1};Persist Security Info={2};User ID={3};Password={4};",
                "Server", "DB", false, "DBUser", "DBPassword");
        SqlConnection conn = new SqlConnection(connectionString);
            conn.Open();

            SqlCommand sqlCommand = conn.CreateCommand();

            sqlCommand.CommandType = CommandType.Text;
            sqlCommand.CommandText = @"SELECT 'asd' AS strName, 'asdasd' AS strName, 'asdasdasd' AS strName";

            SqlDataAdapter da = new SqlDataAdapter(sqlCommand);

            DataTable test = new DataTable();
            da.Fill(test);

            foreach (DataColumn col in test.Columns)
            {
                Console.WriteLine(col.ColumnName);
            }


Is there any property or something, i can access to get the original name?

Thanks
AnswerRe: ADO.net not unqiue column names Pin
Giorgi Dalakishvili17-Nov-08 20:57
mentorGiorgi Dalakishvili17-Nov-08 20:57 
GeneralRe: ADO.net not unqiue column names Pin
BlaiN17-Nov-08 21:42
BlaiN17-Nov-08 21:42 
QuestionControls added to FlowLayoutPanel at runtime are not shown ? Pin
Sperneder Patrick17-Nov-08 20:46
professionalSperneder Patrick17-Nov-08 20:46 
AnswerRe: Controls added to FlowLayoutPanel at runtime are not shown ? Pin
Pedram Behroozi17-Nov-08 21:24
Pedram Behroozi17-Nov-08 21:24 
GeneralRe: Controls added to FlowLayoutPanel at runtime are not shown ? Pin
Sperneder Patrick17-Nov-08 22:32
professionalSperneder Patrick17-Nov-08 22:32 
GeneralRe: Controls added to FlowLayoutPanel at runtime are not shown ? Pin
Pedram Behroozi18-Nov-08 0:52
Pedram Behroozi18-Nov-08 0:52 
GeneralRe: Controls added to FlowLayoutPanel at runtime are not shown ? Pin
Sperneder Patrick18-Nov-08 0:53
professionalSperneder Patrick18-Nov-08 0:53 
QuestionUnable to connect to service application from remote computer. Pin
teopau17-Nov-08 19:53
teopau17-Nov-08 19:53 
AnswerRe: Unable to connect to service application from remote computer. Pin
leppie17-Nov-08 20:21
leppie17-Nov-08 20:21 
GeneralRe: Unable to connect to service application from remote computer. [modified] Pin
teopau17-Nov-08 20:51
teopau17-Nov-08 20:51 
QuestionHow to connect mysql Pin
rose19617-Nov-08 19:34
rose19617-Nov-08 19:34 
AnswerRe: How to connect mysql Pin
N a v a n e e t h17-Nov-08 20:44
N a v a n e e t h17-Nov-08 20:44 
QuestionInsert a subreport within a subreport inCrystal reports using C# Pin
Rajeshgut17-Nov-08 18:41
Rajeshgut17-Nov-08 18:41 
AnswerRe: Insert a subreport within a subreport inCrystal reports using C# Pin
selcuks17-Nov-08 20:37
selcuks17-Nov-08 20:37 
QuestionSQL Report Ranking Pin
jatin.sabarmati17-Nov-08 14:15
jatin.sabarmati17-Nov-08 14:15 
AnswerRe: SQL Report Ranking Pin
Christian Graus17-Nov-08 15:18
protectorChristian Graus17-Nov-08 15:18 
Questionxml Pin
arkiboys17-Nov-08 11:12
arkiboys17-Nov-08 11:12 

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.