|
That would indicate that somewhere the control is capturing the mouse. If you didn't write the code, that's interesting.....
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hello,
I am coding an AddIn for Word and Excel in VS .Net 2008 in C#.
In this AddIn I want to use a secured web service.
I suppose that I need to have login and password that I'll pass in my web method.
The URL begins with "https://..."
The principle :
- I load a Word document from an authenticated website (same site that the web services)
- I have a cookie that contains my sessionID in my browser
My question :
Where can I stock the login/password I have to use for my webmethod?
Do I read these informations from the cookie of my browser (directly from my Word AddIn?)
How else?
Thanks in advance.
Yannis.
|
|
|
|
|
Ok, so I'm working on a project and it has to analyze an income survey. The statistics for each home include: an ID, # of members in the house, annual income, and state of residence. As data is entered into text boxes, it should be assigned from the text boxes to the elements of a structure.
There are three different reports:
Report 1: A 4 column report that displays input data
Report 2: A two-column report that lists the ID and income of any household exceeding average income. The calculated verage income should be displayed on top of report.
Report 3: Percent of households that have income below poverty level.
Here's the poverty level guidelines:
family size, 48 contiguous states, Alaska, Hawaii
1, 14700, 18375, 16905
2, 19800, 24750, 22770
3, 24900, 31125, 28635
4, 30000, 37500, 34500
5, 35100, 43875, 40365
6, 40200, 50250, 46230
7, 45300, 56625, 52095
8, 50400, 63000, 57960
Add for each
additional person, 5100, 6375, 5865
PLEASE someone help me. I've understood code until this point and it's just because I'm trying to teach myself. I just have no idea what to do. If someone could make the code so I could look at it and understand or even part of the code it'd be much appreciated. Thank you.
|
|
|
|
|
Your name is VB Noobie, but this is the C# forum ?
If you're teaching yourself, where did this assignment come from ?
Which bits are you having trouble with ? Is it the code, or the math ? Think about the math, and then think about how you'd break that into steps in code.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I bought an old programming 2005 book because it's out of date and was cheap because they're bringing in the 2008 book and to try and understand the basics and hopefully grasp everything sufficiently. I'm working through the book and there are normally examples in each chapter so I get a code to look at and comprehend what they're doing in the code. The chapter on arrays has a horrible example that has nothing to do with arrays. I just don't understand how to code the array itself. I just need a valid example and this is the first problem from the book I bought.
|
|
|
|
|
The big question is, do you want an example in C# or VB ?
Most people don't use arrays because they are fixed size. However, the concept is the same as a list, you can make a 2D array like myarray[5][5], and then myarray[1] is an array of five elements, which you can then iterate over, or index.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I'm using Microsoft Visual Studio 2005 in C#. I mixed up VB and visual studio. I told you I'm a noob. But yes, an example would be awesome in C#.
|
|
|
|
|
OK, there's a couple of things here
1 - put your data in a structure. Do you know how to do that ?
2 - it doesn't say to use an array, AND it says to store your data as you go, so I think you need a list. You don't need a 2D array at all, as far as I can see.
struct myStruct
{
public int someInt;
public string someString;
}
that's nasty in an OO sense, but it's a rudimentary struct.
List<myStruct> myList = new List<myStruct>();
there's your list.
myList.Add(myStringInstance);
is how you add an item
foreach(myStruct item in myList)
{
item.someInt = 0; // or whatever
}
is how you step over them
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I kind of understand it, but I would really appreciate at least a partial example using the instance I stated in the first post or something similar. I'm more of a fill in the blank memorization kind of person so it would probably help a lot more. Thank you for your quick replies so far.
|
|
|
|
|
"an ID, # of members in the house, annual income, and state of residence."
struct UserData
{
public int ID { get; set;};
public int Income { get; set; };
public string State { get; set;};
public int ResidentCount { get; set; };
}
// this is a member of your main form
List<UserData> _userData = new List<UserData>();
OnClickAdd()
{
UserData data = new UserData();
int id;
if (int.TryParse(UserID.Text, out id))
{
data.ID = id;
}
// do the same for income and residents and add an 'else' for invalid data for both
data.State = comboState.SelectedItem.ToString(); // use a combo so that the states are always the same and can be searched
_userData.Add(data);
}
Now I'd use a struct that contains your three states number values and do a Dictionary which maps that struct to the number of residents. But you can just put the residents into the struct, and do a simple search to find the right one, or even assume you can get it by index.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
struct UserData
{
public int ID { get; set;};
public int Income { get; set; };
public string State { get; set;};
public int ResidentCount { get; set; };
}
what are the get and set?
|
|
|
|
|
They create properties for you, without you having to do it. variables instead of properties that are publically visible are poor form.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I need help in updating a database using a dataset.
Im tryin to update using a value stored in a variable .
this is the code:
stocktrackerDataSet changes = (stocktrackerDataSet)stocktrackerDataSet.GetChanges();
Usage = retail_ProductsTableAdapter.Update(changes);
MessageBox.Show("updated " + Usage , "Success");
stocktrackerDataSet.AcceptChanges();
Im gettin an argumentnull exception
Please can some one help me ?
|
|
|
|
|
c#_novice wrote: Im gettin an argumentnull exception
It would be good to know where you are getting that exception as it makes it easier to help you. However, there are a limited number of places you could get that exception in the code you've shown.
My guess is that the ArgumentNullException was triggered on this line:
Usage = retail_ProductsTableAdapter.Update(changes);
The reason would be that changes is null . Which means that stocktrackerDataSet.GetChanges() returned null .
I'm therefore guessing further that GetChanges is either broken or is supposed to return null if there are no changes. If it is the latter then the solution is to check if changes is null, and if not then pass the changes through to the database.
|
|
|
|
|
i want to execute file.exe from resource how can i do ?
pls give me code or pls upload sample project
Thanks
|
|
|
|
|
wtf [HELP ME] ??? I guess its 'urgent', too, right ???
why dont you
1) learn to be polite
2) learn how to use google
3) come back when you have some code you'd like to discuss
'g'
|
|
|
|
|
hi i am uploading file using ftp the file is uploaded successfully but the reason is that their is no data in it it shows zero(0) bytes. so plz help
|
|
|
|
|
Unless you are doing this with C#, I think this is the wrong board for this question...
|
|
|
|
|
I'm trying to optimize a bit of coding and trying to decide if there's a better way to retrieve a list of paired values. Right now I'm just adding the values to a string and using split to pull them out after the list is made.
The question is, would it be faster to use a list, array or some other collection rather than a string for a randomly sized list of 0 to 24 elements. Each element is a pair of single digit numbers.
Normally I wouldn't worry about something so trivial, however this piece of code will end up looping a few million times.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
|
nice find Mia - I'll remember that
|
|
|
|
|
Like very wow, great link. Thanks much Gonna take a while to digest it all, but I found some great tips I can use now.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
Hi,
if the data initially are numbers, not strings, then don't use strings.
if the first numbers of all pairs have different values, you have two choices:
- the generic Dictionary < int, int > since it stores pairs of numbers, be warned it does not preserve order.
- or, since the range is very limited, have a 10-element array and choose a special value to indicate absence of a pair.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I thought of those, that's why I was asking if someone had more info on their performance. If I use an array, I have to add in code to check what the last used element was, in order to add new values on to the end. If I use a collection (ordering isn't important for the data) then I have the overhead of a linked list. With the string being essentially an array of char[] I was pretty sure it would come down to either the string or just an array if there was enough overhead removal to warrant the code change.
From the link I was given, it looks like that fastest way to go is going to be a 48 element array. Since I'm only dealing with at most 4 of them at a time, they should stay in cache. I only have to keep track of how many elements are there during the adding process to prevent having to scan the array before every addition. For reading I have an easy cheat, since 0 isn't a valid value, I'll know when I hit the last element.
What I think will also help out a lot is some restructuring of the class that's being worked with to produce the number lists in the first place. It's a small class to begin with and I think I can reduce it down to a value type struct, by moving the functions into the container class. If all goes well, the whole mess should fold up into cache with a bit of room to spare. Then it should just come down to figuring out how many sets I can queue up from the database at a time.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
when i Start to create the Project first i did little mess and try some experiment with MS SQL.
Now I working with MYSQL... any way when i publish the project the set file looking for this:
The following prerequisites are required:
* Windows Installer 3.1
* .NET Framework 3.5 SP1
* SQL Server Compact 3.5
* Windows Installer 4.5
* SQL Server 2008 Express Edition
How can i remove the relationship with the these SQL components that i really don't need???
|
|
|
|