|
Hello,
Vasudevan Deepak Kumar wrote: if (DataGridView1[5, a] == null)
I guess this will not help,
if this is true:
for temporary i did
string aaa = DataGridView1[5, a].Value + "D"; if (aaa.Trim )== "D")
its working but i dont like this way
All the best,
Martin
|
|
|
|
|
I think your grid must be having only 5 records from 0 to 4.
So its not geting the 6th record.
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
no buddy you misundertood the question that wasnt the problem, and now problem has been solved...;););)
Becoming Programmer...
|
|
|
|
|
Hello everyone,
Previously, I think if I am using namespace ns1, and declaring and defining a public class cs1 using C# Class Library project, I have to name the output DLL name to be ns1.dll. I have this idea because I noticed that Microsoft names the DLLs, like System.dll for name space System, System.Data.dll for name space System.Data.
Now I tried that I can name the output DLL name to arbitrary name (not ns1), like mylib.dll. Then the applications which use the DLL still work.
So, I think the conclusion should be, we can use arbitrary name which is not related to namespace. Right?
thanks in advance,
George
|
|
|
|
|
I assume the name of the assembly does't matter as long as you added your assembly to your project and the contents in the assembly is not changed.
|
|
|
|
|
Thanks zion417,
I think you are also not following the naming convension which Microsoft does (e.g. namespace.dll). Right?
regards,
George
|
|
|
|
|
It depends on my project.Normally we follow the same convension .Root.Child1.. etc. I was just saying the name of the "assembly" done actually matter.
|
|
|
|
|
Thanks zion417!
regards,
George
|
|
|
|
|
how to use contains method
I want to search more than one string like this
line.Contains("AssemblyVersion","AssemblyCompany","AssemblyProduct","AssemblyCopyright","AssemblyTrademark","AssemblyCulture")
how could i search??
plz reply if anybody knows
Thanks
|
|
|
|
|
Hello,
Other then Regex,
what you need is not implemented in the framework string class, AFAIK. (At least not in .Net 1.1)
The string class provides the IndexOfAny method, which only is able the search for chars.
But you could use a self written method!
Like this:
This method returns the startindex of the string which is found first.
public static int IndexOfAnyString(string TextToParse, string[] TextsToSearch)
{
int index=-1;
if(TextsToSearch!=null)
{
foreach(string actSearchText in TextsToSearch)
{
if(actSearchText!=null && !actSearchText.Equals(string.Empty))
{
index = TextToParse.IndexOf(actSearchText);
if(index>=0)
{
break;
}
}
}
}
return index;
}
In .Net > 1.1, you could use the "Contains" method instead of "IndexOf"!
Call it like this:
string mainline = "Hello codeproject world";
int index = IndexOfAnyString(mainline, new string[] {"msdn", "codeproject ", "blablabla"});
This is just a basic implementation of the problem.
You could add some more features like:
case sensitivity (true/false)
out param string, which returns the matching string
returning an array of int index values for all search texts
.
.
.
Hope it helps!
-- modified at 1:43 Friday 31st August, 2007
All the best,
Martin
|
|
|
|
|
Thanks For reply..
I'm using like this
if (line.Contains("AssemblyVersion")||line.Contains("AssemblyCompany")||line.Contains("AssemblyProduct")||line.Contains("AssemblyCopyright")||line.Contains("AssemblyTrademark")||line.Contains("AssemblyCulture"))
{
line = string.Concat("// ", line ," // comment");
}
its working..
But its adding comment withount indenting means..
AssemblyProduct //comment
AssemblyProduct //comment
AssemblyProduct //comment
but i want indentation like this
AssemblyProduct //comment
AssemblyProduct //comment
AssemblyProduct //comment
how i make indentation...
if you know then plz reply..
Thanks in advance
-- modified at 3:16 Friday 31st August, 2007
|
|
|
|
|
you can also use if statement
if (line.Contains("AssemblyVersion") && line.Contains("AssemblyCompany") && line.Contains("AssemblyProduct")........)
Becoming Programmer...
|
|
|
|
|
I want to get the WiFi information (eg. signal strength) from code (eg. C++, C#).
OS may be XP, CE5.0 or above.
I know it can be related to ndisuio.
Where can I get more coding information?
Thanks!
|
|
|
|
|
|
|
Hello folks,
I have a rather large image, whose size is around 6000 x 5000 pixels...
I would like to perfom image normalization and other such operations...which include some mathematical calculation for each pixel..
But when I do this on my image, it take about 20 mins to finish...
How to speed it up...??
Here is the normalization code which I am running..
public void NormalizeImage(ref Bitmap objBitmap, int iMaxColor)
{
DateTime dt = System.DateTime.Now;
System.Diagnostics.Trace.WriteLine(" Normalizing Image: " + dt);
int iX = objBitmap.Size.Width;
int iY = objBitmap.Size.Height;
int iMaxINTColor = 16777215;
try
{
for (int i = 0; i < iX; i++)
{
for (int j = 0; j < iY; j++)
{
int iPrevColorVal = objBitmap.GetPixel(i, j).ToArgb();
//if (iPrevColorVal < 0)
// iPrevColorVal = iPrevColorVal * -1;
int iNormalizedVal = System.Convert.ToInt32(Math.Pow((iPrevColorVal / iMaxColor), 1)) * iMaxINTColor;
objBitmap.SetPixel(i, j, Color.FromArgb(iNormalizedVal));
}
}
}
catch
{
System.Diagnostics.Debug.Assert(false);
}
DateTime dt2 = System.DateTime.Now;
System.Diagnostics.Trace.WriteLine("Done Normalizing Image:" + dt2);
}
|
|
|
|
|
Hi Safee,
The problem is the call to SetPixel. It's horribly slow. You can use the free .NET library FastBitmap[^] to speed up pixel operations, which will result in your algorithm being much faster.
|
|
|
|
|
|
|
Hey all, i need some help..
I'm using C# language for my project.. I'm having problems with my RTC program..
The program cannot make outgoing calls to the SIP server and VoIP phone..
But the SIP server and VoIP phone can call the RTC program..
This is the part of the code which enables the SIP server to connect with the program..
string bstrProfileXML = "<provision key=\"testing\" name=\"testing\">";<br />
bstrProfileXML += "<user uri=\"sip:102@152.226.136.17\" account=\"\" password=\"\" realm=\"\" />";<br />
bstrProfileXML += "<sipsrv addr=\"152.226.136.17:5060\" protocol=\"udp\" role=\"proxy\" />";<br />
bstrProfileXML += "<sipsrv addr=\"152.226.136.17:5060\" protocol=\"udp\" role=\"registrar\" />";<br />
bstrProfileXML += "</provision>";<br />
oProfile = oClient.IRTCClientProvisioning2_CreateProfile(bstrProfileXML);<br />
oClient.IRTCClientProvisioning2_EnableProfile(oProfile, RTCRF_REGISTER_ALL);
Anyone can help me??
|
|
|
|
|
Because your question involves intimate knowledge of this 3rd party RTC component, you may not receive a meaningful answer here. Have you tried posting your question in the RTC manufacturer's forums or support desk?
|
|
|
|
|
No i haven't tried posting it sumwhere else.. only cause the codes i'm using are of C# language..
But i'll try anyways.. Thanks..
|
|
|
|
|
I solved the problem below, what I found was that when I built in data relations into the dataset it created the problem described. How do I build a data relation into my tables without getting the error.
I have a DataSet with 5 tables and a Form with tabs and a grid on each tab to view the data in the DataSet. I have used the add datasource to attach the DataSet DataBinder, and DataAdapter to the grids. However when I try call the form I get the following error message concerning my DataSet:
"Object reference not set to an instance of an object."
Yet the following line is in my code.
this.dataSet_I = new AnalysisCSLib.DataSets.DataSet_I();
Furthermore from other classes I have received the same message and also received a message stating Parent and Child Columns not set or something similar.
Any ideas as to what the problem is here, I would greatly appreciate your help.
Thanks in advance.
Michael
-- modified at 21:59 Thursday 30th August, 2007
|
|
|
|
|
Is DataSets null? If not, is there something in the DataSet_I constructor that's null and being dereferenced?
|
|
|
|
|