|
Jammer - sorry about that. My OT was actually aimed at Christian, but there are good points between you and Luc.
|
|
|
|
|
Gotcha! I was racking my addled brain trying to think of what you might be referring too with that one.
haha ... there have been so very many issues!
Regards,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
I have a method that convert a number to a letters created with c#.net.
if i wanna use this methodin excel so when someone insert a number in a cells in excel i wanna to load directly the letters corresponding to this number in the other cell.
Some one tell me to use the macros.
But i don't know how to use them. is there any help?????
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
Not a C# question, unless C# runs inside Excel now ? I think VBScript is what runs inside Office apps.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: I think VBScript is what runs inside Office apps.
Nope. VBA.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Potayto - potahto :P
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello you. My name is saIam, am working on a window application on C#, the application is to get records of orders from a sales point and package the orders for the day after closure, then send as an email to the manager who works in a seperate office or might even be out of town just to enable him keep track of the daily sales at various stores. i have modelled the application but could not get the mailing aspect right just couldnt the config right .please need help on setting and configuring mail in window application with c#. Many thanks in anticipation.
stay jacking
|
|
|
|
|
What do you mean by 'config' ? You're failing to set a proper SMTP server ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes
fine, you msut give smtp server name ,port ,username ,password and etc.
this is way, please use the Appconfig file add all ur attributes.
after you can access by the configuration class in .net.
thanks
|
|
|
|
|
Forgive my dull C# questions, but I am a sometimes programmer needing to get up to speed very quickly:
1) Want to dynamically rename a variable within the loop, as in
AltChunkpart#
would become
altChunkpart1
altChunkpart2
etc.
2) Similarly, but it seems to be a special URI-specific case to be part of this line:
Uri uri# = new Uri("/programDescription#.txt", UriKind.Relative);
Uri uri#
would become
Uri uri1
Uri uri2
etc.
Failing to increment the 'uri' within the loop produces this error: "A local variable named 'uri' cannot be declared in this scope because it would give a different meaning to 'uri', which is already used in a 'parent or current' scope to denote something else"
Any guidance will be sincerely appreciated.
Jogannon
|
|
|
|
|
1 - can't be done. Instead, make an array and put that ending digit as the index into the array
2 - can't be done.
Your overall issue is that you have something like this:
Uri uri
for(whateveR)
{
Uri uri;
}
The second Uri can't have the same name as one in the higher scope. Just use a different name, it doesn't need to be different on each iteration, it just needs to be different than the name of the variable it would otherwise hide. Or, just use the same one, if the value does not matter in the higher scope.
string s = "one";
for(whateveR)
{
s = "two";
}
// now s == "two"
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian. Great explanation. Now let me go and try to apply it.
Jogannon
|
|
|
|
|
Christian,
I am sorry to be so thick, however I understand the underlying need to have unique variable names. It is a matter of how does s == "two"? I do not see any counting or incrementing code in your example. My own approach (which fails) is to try and append (or concatenate an incrementing int value to the string name. Should I avoid this approach and go with a string array technique instead. Any concrete example will really help at this point.
Thanks,
Jogannon
|
|
|
|
|
"one" and "two" were arbitrary examples - the point was simply that the value given to the variable inside the second scope, applied to the first scope, too. I was illustrating that in your instance, you have a variable named uri in the outer scope, and so you couldn't create one with the same name in the inner scope, and if you reused the outer scope one to keep the same name, you would find that setting it, changed it for the outer scope.
Wow, now I'm confused
I was showing that if you used uri where you were putting Uri uri and getting the error, you would have flow on effects.
If you need to keep the variables you wanted to name uri1, uri2, etc for any reason, a list or array is the way to do that. If you were creating a variable for loop processing that is not reused, then just use a different name, like uriLoop or something.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks again, Christian. Let me go and work on this.
Jogannon
|
|
|
|
|
Member 2789142 wrote: it seems to be a special URI-specific case to be part of this line
no, its not uri specific. you try to declare the variable named "uri" multiple times, which is not allowed in this case.
int myInt = 0;
foreach (object obj in objList)
{
int myInt = 4;
}
|
|
|
|
|
I need to indicate that WinForms DataGridView column in sorted.
If column width is too small, sort glyph is not displayed.
Is it possible to force sorth glyph to display in narrow columns also or any other idea how to indicate that column is sorted?
I tried also to underline column caption in mouseclick event but this fails also.
I tried
foreach (DataGridViewColumn dataGridViewColumn in grid.Columns) {<br />
DataGridViewCellStyle dgvcellStyle = new DataGridViewCellStyle();<br />
System.Drawing.Font font = new System.Drawing.Font( <br />
dataGridViewColumn.HeaderCell.Style.Font,<br />
System.Drawing.FontStyle.Underline );<br />
dgvcellStyle.Font = font;<br />
dataGridViewColumn.HeaderCell.Style = dgvcellStyle;<br />
}
But got exception probably since debugger shows that
dataGridViewColumn.HeaderCell.Style.Font
is null.
dataGridViewColumn.HeaderCell.Style is not null.
How to fix ?
Andrus
|
|
|
|
|
Hello Forum
I am now getting familiar with LINQ and in need of some help,
I have I Products table with 20 columns but I want to query only 2 columns, the simple way of querying the data
List<Product> ItemList = (from items in dataContext.Products
select items).ToList();
The issue I have is with this example, I am getting back much more data that I really need which is creates extra network traffic etc.
How can I crate a list that will implement only 2 columns of the Product class and the LINQ statement will look something like this
List<Product> ItemList = (from items in dataContext.Products
select new { items.Item_Code, items.Item_Name }).ToList();
|
|
|
|
|
Please don't cross post in multiple forums. It generally won't help you get an answer any quicker. The original post is here[^].
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Correct,
I placed the first post not in the correct forum
|
|
|
|
|
belzer wrote: I placed the first post not in the correct forum
No problem. It is OK to delete a post in this situation, unless there are replies to it. In any case, if you realized it wasn't in the correct forum a link pointing to the correctly placed question is always useful.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
So is this LINQ to SQL or objects? It sounds like dataContext.Products is a custom object in your data access layer. Have you tried to compile your second example? You may need to do something like this:
var ItemList = (from items in dataContext.Products
select new { items.Item_Code, items.Item_Name });
foreach(var x in ItemList)
{
Console.WriteLine("{0} - {1} ", x.Item_Code, x.Item_Name);
}
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
What i ended up doing is the following
var ItemList = (from items in dataContext.Products
select new { items.Item_Code, items.Item_Name }).ToList();
thanks.
|
|
|
|
|
Sounds like that is working for you then...this looks like what I suggested in my last reply (minus the foreach loop, which was there simply as testing).
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Hi all,
I need to perfome simple-looking task in C#: Converting byte array to short array - meaning that if my byte array has 100 cells, my short array will have 50 cells.
If it was C/C++ it was simple, using pointers. However in C# I just can't do it - I've already tried using 'unsafe' block and memory pinning using GCHandle, with no success.
Another thing that bothers me in the solutions I found is that the conversion is done using memory copying, which is not necessary, since all the information is already there!
I'll be grateful for any solution!
Thanks,
Eyal.
|
|
|
|