|
Whehe, aight, nice solution
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
In a C# 2010 application, I am working with data that is obtained from an excel spreadsheet 2007 or exccel 2010. I want to be
ae to see all the values in a particular row. In the code below I want to see all the values in the row called dt.Rows[j]. Basically I want to know how to obtain all the values for the column called [k] in the statement dt.Rows[j][k]
System.Data.DataTable dt = tt.GetExcelDataTable();
for (int j = 0; j < dt.Rows.Count; j++)
dt.Rows[j][k].ToString();
Can you tell me how I can see the values I am looking for?
|
|
|
|
|
This code will print your data one row in a line with data in each row comma separated
System.Data.DataTable dt = tt.GetExcelDataTable();
for (int j = 0; j < dt.Rows.Count; j++) {
string rowData = string.Empty;
for (int k = 0; k < dt.Columns.Count; k++) {
rowData += dt.Rows[j][k].ToString() + ", ";
}
Console.WriteLine(rowData);
}
modified 27-Aug-12 20:45pm.
|
|
|
|
|
I want to be able to see all the values while I am debugging the application. How would you accomplish this task?
|
|
|
|
|
The code I provided will print all the data one row in a line. However if you wish to see data in individual rows/columns, Visual Studio's debugging tools do a great job, just hover your mouse over the 'Rows' variable and Visual Studio will show you it's contents. Here[^] is a video that explains this feature.
|
|
|
|
|
You can keep the break point in line 1 of your code.
System.Data.DataTable dt = tt.GetExcelDataTable();
for (int j = 0; j < dt.Rows.Count; j++)
dt.Rows[j][k].ToString();
Now when the control reaches here, the line color changes to yellow. Press F10 now.
Now, place the mouse over dt , you'll find a search icon, near the tip of the cursor. Click on that. It opens up the table for viewing.
|
|
|
|
|
I think your second for loop should have been edited after you pasted it.
|
|
|
|
|
Edited. Thanks. You do have an eye for details.
|
|
|
|
|
i need more information and what is the uses of Candidate Key, any one can help with example?
Thanks,
Alagiri
|
|
|
|
|
This has nothing to do with C#, and the forum is not a school. Search for "Normalization", and get to know Codds laws. There are a lot of articles and books on the subject, I do not see the need for a personalized tutorial.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Alagiri.periyasamy@merrillcorp.com wrote: Candidate Key
That is the special key that candidates are given so they can get into the special Candidates Executive Washroom so that they can be segregated from normal people.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Is that what they told you as they handed you the key?
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Well yeah that's what they said but when I used the key, it opened the doors to an empty elevator shaft. And when I continued through, I fell to my death. Not sure what the message was supposed to be...
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
This forum is a place for people to help you with specific technical problems. Do not expect to use it like a tutorial. Googling the term will give you tons of reference material.
|
|
|
|
|
Hi,
What is the primary key, super key, foreign key and candidate key in the DBMS?
|
|
|
|
|
What is GOOGLE[^]. 108,000 results await your perusal.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Hi everyone! I have an application that saves the profile of registered members onto a database. When creating member profiles, I need to capture members' photos in the process from a webcam.
Is there any way I can programmatically determine the presence of a webcam and start it? I will then need to send webcam images onto a form before and after the image has been captured for the user to view the captured image.
Any suggestions, please? Thanks in advance.
|
|
|
|
|
You can do this via WMI.
Try searching through the samples here[^] to see if something suits you.
|
|
|
|
|
|
Need to deploy the web samples from IIS Express 7.5 server. I have some web samples in different platforms (Asp.NET,Asp.Net MVC, Silverlight) projects. i have created a startup exe to run the sample browser.
If IIS Express 7.5 has been installed in the machine, then include the entries in an xml file . with reference to xml file web samples will run using IIS Express 7.5. If the machine has IIS express 7.5 installed means the web samples has been run from the IIS Express 7.5, else it has been run from the default ASP.Net web development server.
How to deploy the web samples into IIS Express 7.5 server using c#?
can anyone please help?
Thanks in advance
modified 27-Aug-12 8:40am.
|
|
|
|
|
Hi All,
I need to bind the table data in gridview with some alteration. I have table like below
Table structure
Application 1-NA RED Comment
Application 1-LN Amber Comment
Application1 -ZU Green Comment
Application 1-NA RED Comment
Application 1-LN Amber Comment
Application1 -ZU Green Comment
I want to cut the application name and want to put as a separate column (heading) and rest of part as region. And bind it with datagrid. Logic or sample of code would be appreciated.
I am looking for gridview like below
Application 1
NA Red Comment
LN Amber Comment
ZU Green Comment
Application 2
NA Red Comment
LN Amber Comment
ZU Green Comment
|
|
|
|
|
Add another column to your datatable (I would do this in the select statement) and calculate the short name. In your datagrid do not bind the full name field (or hide it by setting the width to 0)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am trying to pass a variable from one function into another one. However, seeing as I am still in college learning C# I'm not that good yet. While this IS for an assignment it is only a small part of the assignment but a critical one I need in order to finish my program. Below is the code I have.
What I want to do is pass the variable str to a different function which will store that amount for use in another class.
public void RollStr()
{
attributes BaseClass = new attributes();
int Str;
Str = dice.Roll5D6();
Console.Write("Str: {0} \n", Str);
char MyChoice;
string MyInput;
char ReRoll = Convert.ToChar("y");
Console.Write("Would you like to reroll this score?");
MyInput = Console.ReadLine();
MyChoice = Convert.ToChar(MyInput);
if (MyInput == Convert.ToString(ReRoll))
{
BaseClass.RollStr();
}
}
This is the other function I want to store it in. Seeing as I have no ideal how to store it I haven't gotten anything in it yet.
public void ShowAbilities()
{
}
IF anyone can help me figure out how to pass the str variable into ShowAbilities I would be extremly happy. I have been messing with this program for a week now and no closer to figuring this part out and my tutors are gone until Monday, which is past the deadline for this assignment. IF I can't get help tonight I will be late with this assignment.
|
|
|
|
|
drgsldr69 wrote: public void ShowAbilities(string str)
{
}
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Can you do multiple variables like that? All together there is 6 functions just like the str one that i need to do lol.
|
|
|
|