Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dns.GetHostAddresses Question Pin
Richard MacCutchan11-Jul-20 22:54
mveRichard MacCutchan11-Jul-20 22:54 
AnswerRe: Dns.GetHostAddresses Question Pin
Gerry Schmitz12-Jul-20 6:45
mveGerry Schmitz12-Jul-20 6:45 
QuestionOnly one usage of each socket address - error Pin
pkfox10-Jul-20 1:22
professionalpkfox10-Jul-20 1:22 
AnswerRe: Only one usage of each socket address - error Pin
Richard MacCutchan10-Jul-20 3:19
mveRichard MacCutchan10-Jul-20 3:19 
GeneralRe: Only one usage of each socket address - error Pin
pkfox10-Jul-20 4:39
professionalpkfox10-Jul-20 4:39 
GeneralRe: Only one usage of each socket address - error Pin
Richard MacCutchan10-Jul-20 4:58
mveRichard MacCutchan10-Jul-20 4:58 
AnswerRe: Only one usage of each socket address - error Pin
Dave Kreskowiak10-Jul-20 3:24
mveDave Kreskowiak10-Jul-20 3:24 
GeneralRe: Only one usage of each socket address - error Pin
pkfox10-Jul-20 4:40
professionalpkfox10-Jul-20 4:40 
GeneralRe: Only one usage of each socket address - error Pin
Gerry Schmitz12-Jul-20 6:33
mveGerry Schmitz12-Jul-20 6:33 
Questionindex was out of bound of the array Pin
niceruyu10-Jul-20 1:00
niceruyu10-Jul-20 1:00 
AnswerRe: index was out of bound of the array Pin
OriginalGriff10-Jul-20 1:35
mveOriginalGriff10-Jul-20 1:35 
AnswerRe: index was out of bound of the array Pin
harold aptroot10-Jul-20 1:39
harold aptroot10-Jul-20 1:39 
AnswerRe: index was out of bound of the array Pin
Richard MacCutchan10-Jul-20 3:16
mveRichard MacCutchan10-Jul-20 3:16 
AnswerRe: index was out of bound of the array Pin
Dave Kreskowiak10-Jul-20 3:22
mveDave Kreskowiak10-Jul-20 3:22 
AnswerRe: index was out of bound of the array Pin
Swapnita Dessai19-Jul-20 0:47
Swapnita Dessai19-Jul-20 0:47 
QuestionHow to map excel column value to custom defined object class Pin
Member 148591514-Jul-20 6:56
Member 148591514-Jul-20 6:56 
AnswerRe: How to map excel column value to custom defined object class Pin
Mycroft Holmes4-Jul-20 13:53
professionalMycroft Holmes4-Jul-20 13:53 
GeneralRe: How to map excel column value to custom defined object class Pin
Member 148591515-Jul-20 3:41
Member 148591515-Jul-20 3:41 
GeneralRe: How to map excel column value to custom defined object class Pin
Mycroft Holmes5-Jul-20 12:33
professionalMycroft Holmes5-Jul-20 12:33 
GeneralRe: How to map excel column value to custom defined object class Pin
Member 148591516-Jul-20 1:46
Member 148591516-Jul-20 1:46 
Here is the function:

public static IList<TestDataModel> GetAllTestData(string keyName)
        {
            DataSet ds = new DataSet();
            DataNamesMapper<TestDataModel> mapper = new DataNamesMapper<TestDataModel>();
            DataTable dataTableALL = new DataTable();
            List<TestDataModel> testData = new List<TestDataModel>();
            using (var connection = new
                          OdbcConnection(TestDataFileConnection()))
            {
                connection.Open();
                OdbcCommand cmd = new OdbcCommand();
                cmd.Connection = connection;

                System.Data.DataTable dtSheet = null;
                dtSheet = connection.GetSchema(OdbcMetaDataCollectionNames.Tables, null);
                foreach (DataRow row in dtSheet.Rows)
                {
                    string sheetName = row["TABLE_NAME"].ToString();

                    if (!sheetName.EndsWith("$"))
                        continue;

                    // Query each excel sheet.
                    var query = string.Format("select * from [{0}] where TestName = '{1}'", sheetName, keyName);
                    cmd.CommandText = query;

                    DataTable dt = new DataTable();
                    dt.TableName = sheetName;

                    OdbcDataAdapter da = new OdbcDataAdapter(cmd);
                    da.Fill(dt);
                    ds.Tables.Add(dt);
                }
                cmd = null;
                connection.Close();
            }
            DataTable data= JoinExcelDatatoOneRow(ds);
            testData = mapper.Map(data).ToList();
            return testData.ToList();
        
        }

AnswerRe: How to map excel column value to custom defined object class Pin
Mycroft Holmes6-Jul-20 12:49
professionalMycroft Holmes6-Jul-20 12:49 
QuestionHow to get the actual, GENERATED source code from my site? Pin
Member 139493623-Jul-20 10:05
Member 139493623-Jul-20 10:05 
AnswerRe: How to get the actual, GENERATED source code from my site? Pin
Mycroft Holmes3-Jul-20 12:30
professionalMycroft Holmes3-Jul-20 12:30 
AnswerRe: How to get the actual, GENERATED source code from my site? Pin
F-ES Sitecore5-Jul-20 5:31
professionalF-ES Sitecore5-Jul-20 5:31 
QuestionTask.Run.Wait Pin
Bernhard Hiller3-Jul-20 0:16
Bernhard Hiller3-Jul-20 0:16 

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.