|
Hei Ashfield, thanks for your answer, Yes I have tried the debugger to see whats going on in the application. In fact debugging the code, I've come to the point that it tries to run the delegate part of first iteration after all the other iterations have completed.
After completing all the iterations, it comes to the end line, increases "u" by one and then returns to the delegate line and tries to execute it with "u"s value equal to something wrong.
Thabks again for your help.
|
|
|
|
|
Hi all,
I've two Datagridview controls. Each grid has different datasources.
Eg. Datasource of grid1 is Hastable.
Datasource of Grid1 is datatable.
i want to display all the columns in both gridcontrol in the same order.
Eg if Grid1 has columns in the order like Name,Age,DOB,SAL and i want the same order in grid2 also.
i'm trying to set displayindex. but it's not displaying in the same order.and also want to add Scrollbars if necessary.
Everything has to be done programatically. can anyone help me?
thanks in advance
sri
|
|
|
|
|
So you want the event from 1 datagridview to be replicated on the other DG and the event is the sorting of the columns when the user clicks the column header. Do you start to see a pattern here.
Take a look at the events available for the DG, there are lots of them and many for the column header. Identify the one used by the DG for sorting and replicate the event on the other DG (you will need a flag to identify the source so you don't fall into an endless loop).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello,
(first im sorry for my english ist verry bad (
since 3 days i try to get the FileInfo like Author, Album, Tracknumber, Genre ect. of an audio file, but i faild.
i found an article shows exactly what i want but its in c++ http://www.codeproject.com/KB/audio-video/cmp3info.aspx[^]
Has anyone an idea how to get this informations?
thanks a lot
modified on Tuesday, September 30, 2008 1:30 PM
|
|
|
|
|
You need c# version of id3 tag library. A simple search on Google or codeproject should bring helpful results.
|
|
|
|
|
problem was to search somethink i dont know.
now i know that its called id3 tag
thank you verry much
|
|
|
|
|
You are welcome. Hope you will be able to find interesting results.
|
|
|
|
|
i need to use array. is there a way to do array in C# whereby it has a key and value like this =>
string[] strarray;
strarray["name"]="chris"
strarray["age"]="10"
strarray["gender"]="male"
or is there any method to do something like this?basically i wanna store into an array whereby the key correspond to the database field.
|
|
|
|
|
sounds like you need a hash table.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
hash table looks rather complicated. is there a simple declaration and assigning of variable kinda thing?
|
|
|
|
|
Use the Dictionary class.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hellow i want to use the LPT Port as an i2c bus
does some one have an example of code?
|
|
|
|
|
Do you know why I do not get the list of printers on a particular Remote machine (win server 2003 SP2) using the following code?
No error is returned.
PrintServer myPrintServer = new PrintServer(@"\\" + txtServerName.Text.Trim());
// List the print server's queues
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
String printQueueNames = "My Print Queues:\n\n";
foreach (PrintQueue pq in myPrintQueues)
{
printQueueNames += "\t" + pq.Name + "\n";
}
|
|
|
|
|
How do i append the character \ to a string
rtf = rtf + @"\"; this is not working now is this
rtf = rtf + "\\"; neither this
rtf = rtf + "\";
Thank you.
|
|
|
|
|
Both of the first two work fine for me.
3rd one won't work because the \ sign is escaping the second " so you never actually close the quotes.
Simon
|
|
|
|
|
Thank you
for me the first two lines are adding two // but i want only 1 and the last one is an escape char.
|
|
|
|
|
Are the two \'s appearing in your output, or only in the debugger? The latter will of necessity show slashes used as escape characters when you look at a string. If it's the former, you need to provide a small program that reproduces this so we can see what you';re doing wrong.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Its because you are viewing it in the debugger I suspect. If you just hover the mouse over it it shows \\, but if you look at it using the text visualiser it will be correct. Its caught me out before...
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thank you all for your assistance
Yes im viewing in the debugger, my problem is i want to search for a string and replace it with another but on the one im searching i want to append the "\" to it.
like
string str = @"\\";
string rtf1 = rtf.Replace("alt=\"\" src=\"/Web%20Cleint/Home%20Page/Images/Stop.png\"", rep);
rtf = rtf.Replace(MatchList[i].ToString() + str.Substring(1,1), rep);
on rtf1 there is a "\" after the pgn. but MatchList[i].ToString() doesnt have the "\" and i cant include it in my search(regx) as well.
|
|
|
|
|
No you can't
"abc\" is impossible...............
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
\ is an escape character both in C# and RTF, so you'll have to escape it twice.
rtf = rtf + @"\\";
or
rtf = rtf + "\\\\";
|
|
|
|
|
Thank you all for your assistance
Yes im viewing in the debugger, my problem is i want to search for a string and replace it with another but on the one im searching i want to append the "\" to it.
like
string str = @"\\";
string rtf1 = rtf.Replace("alt=\"\" src=\"/Web%20Cleint/Home%20Page/Images/Stop.png\"", rep);
rtf = rtf.Replace(MatchList[i].ToString() + str.Substring(1,1), rep);
on rtf1 there is a "\" after the pgn. but MatchList[i].ToString() doesnt have the "\" and i cant include it in my search(regx) as well.
|
|
|
|
|
rtf = "Testing Image Embading \r\n<src> \r\nEmage Embabeded here\r\n"
Regex exp = new Regex(@"img (alt=\.)?([^\.]+)\.png", RegexOptions.IgnoreCase);
string InputText = rtf;
MatchCollection MatchList = exp.Matches(InputText);
Match FirstMatch = MatchList[0];
for (int i = 0; i < MatchList.Count; i++)
{
string str = @"\";
string rtf1 = rtf.Replace("alt=\"\" src=\"/Web%20Cleint/Home%20Page/Images/Stop.png\"", rep);
string strToReplace; //= MatchList[i].ToString(); //;+ str;
//strToReplace = strToReplace.Substring(0, strToReplace.Length);
strToReplace = string.Format(@"{0}\", MatchList[i].ToString());
rtf = rtf.Replace(strToReplace, rep);
i hard corded rtf1 and it worked fine so what i want is for strToReplace to be equal to this string Web%20Cleint/Home%20Page/Images/Stop.png\"
and im trying to achieve that by using this string string strToReplace; //= MatchList[i].ToString() + str;
it appends 2 \\ and doesnt match the other string
I hope this will help.
|
|
|
|
|
This is my code snippet
foreach (KeyValuePair<string,> keyValue in queryList)
{
string strQuery = keyValue.Value;
Progress.lblMessage.Invoke((MethodInvoker)delegate()
{
Progress.lblMessage.Text = "Creating table " + keyValue.Key;
Progress.Text = m_fmProgress.lblMessage.Text;
});
new SqlCommand(strQuery, sqlConn, sqlTransaction).ExecuteNonQuery();
Progress.lblMessage.Invoke((MethodInvoker)delegate()
{
Thread.Sleep(100);
Progress.pbCurrentProgress.Value =
Convert.ToInt32(iProgress * (100.0 / queryList.Count));
Thread.Sleep(50);
});
iProgress++;
}
Is this method is correct to show progress
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Background: I built a really cool chat that just uses ajax and asp.net pages. Its even event based. I had to build it because nothing else out there does what I want.
Problem: I have to store the chat messages and some other things as global variables in the application variable. Like List<chatmessage> msgList.
But I get invalid cast exceptions when I try to initialize a local variable of the same type. Its because its not thread safe. So, from different threads List<ChatMessage> isn't the same type.
my only other solution is to create a separate list for each property of ChatMessage. like List<string> msgList_msg; List<string> msgList_is_blocked, List<string> msgList_date, List<string> msgList_userId.
I don't want to do that but I don't feel like I have a choice.
Any Ideas or Suggestions?
modified on Tuesday, September 30, 2008 9:09 AM
|
|
|
|