|
Esmo2000 wrote:
I think that the question would not be wholly unfounded if he is just looking ahead a bit.
You may be right. But experience has taught me otherwise.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Hi
Just to add one more point to what Eiso is already told. While navigating through a collection using foreach loop we cant modify the collection. Where as we can do that while using for loop.
Thanks
SGS
|
|
|
|
|
i am a beginner at this and hav been given a exercise to do to test if a word is a palindrome. a palindrome is a word that is spelt the same reversed.eg.madam,mom,dad etc.how would you go about doing it.
uni1985
|
|
|
|
|
Homework is not a palindrome.
BTW, what word have you been asked to test with?
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Hi,
Reverse the string and compare it with the original. If they match, then the word is a palindrome.
Regards
Senthil
|
|
|
|
|
this should get you started
public bool IsPalidrome( string strWord )<br />
{<br />
string upperString = strWord.Trim().ToUpper();<br />
for ( int x = 0; x < (upperString.Length / 2); x++ )<br />
{<br />
if ( upperString[x] != upperString[upperString.Length - x - 1] )<br />
return false;<br />
}<br />
return true;<br />
}
Don't just copy and use, figure out what is going on, or you'll never learn the basics of what you need to know.
- DougW48
dwright@tdci.com
|
|
|
|
|
i have created a client server application. after installing the deployed client application, it cannot connect to the server. but it could connect when ran using the solution. do i need to add anything to the deployment project to make it work? what could be the problem?
|
|
|
|
|
myname01 wrote:
what could be the problem?
Many things. In your solution, did you connect to your server using localhost or an IP address? If so, make sure that IP address is now the address of the server.
Also, when talking to applications across machine boundaries, which is what I assume you're doing, things like firewalls often come into play. If your client application connects to the server on a specified port, make sure that the firewall on both the client and server have that port opened. This is true for both software firewalls, such as Windows XP Firewall, and hardware firewalls, such as a router. If your client is connecting to a server within the same LAN as the client, then only software firewalls will apply.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Hi All
I have the wierdest problem with Crystal Reports for Visual Studio.Net 2003.
I wrote a report, to be displayed in the Crystal Reports viewer from within my C#.Net component. It worked fine. I then went and modified the report (minor formatting changes, put a title in, etc), and now I can't get the friggin' thing to update! I've copied and re-copied the new report file over, but when I generate the report from within my app, it still shows the old one!
I am NOT building the report into the assembly ("Build Action" -> "None"), so I'm sure that's not the problem. Either that or it's building anyway. Funny thing though is that I've REBUILT the assembly and it's still the wrong report! I've checked it in the designer, and my changes are there, but the old report is still displaying when I generate it from my app. Sorry I can't think of any other way to describe the problem (I've searched the 'net flat and found nothing relevant - I guess if I COULD think of a better way to describe my problem I might've found something <g>).
Any ideas or code?
--------------------------------------------------------------------------------
|
|
|
|
|
Hi All
I have the wierdest problem with Crystal Reports for Visual Studio.Net 2003.
I wrote a report, to be displayed in the Crystal Reports viewer from within my Visual Basic.Net component. It worked fine. I then went and modified the report (minor formatting changes, put a title in, etc), and now I can't get the friggin' thing to update! I've copied and re-copied the new report file over, but when I generate the report from within my app, it still shows the old one!
I am NOT building the report into the assembly ("Build Action" -> "None"), so I'm sure that's not the problem. Either that or it's building anyway. Funny thing though is that I've REBUILT the assembly and it's still the wrong report! I've checked it in the designer, and my changes are there, but the old report is still displaying when I generate it from my app. Sorry I can't think of any other way to describe the problem (I've searched the 'net flat and found nothing relevant - I guess if I COULD think of a better way to describe my problem I might've found something <g>).
Any ideas?
P.S. Also sorry I couldn't find a more appropriate forum for this thread. It doesn't relate to VB, as I'm sure the problem would be exactly the same from a C# app. Therefore, it doesn't relate to C# either.
--------------------------------------------------------------------------------
He is lawful good, not lawful stupid
|
|
|
|
|
My first suggestion would be to delete the old file and don't copy the new one over.
Then if your app still shows a report, it obviously is looking in a different location to the one you are updating.
Second question,
How are you loaded the report? Is it via code or did you do it all in the form designer?
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
When i delete the file it doesn't show up meaning it sees the right file.
Answer to the second question:
I'm using the form designer to load my report instead of code.
|
|
|
|
|
Hi guys,
I can't find this anywhere on the web after googling for hours, so the first person with the correct answer will be awarded the title of "Genius".
Here's my problem: I'm doing some late binding in C# with PowerPoint (automation). I can call methods and get/set properties using Type.InvokeMember, for example:
returnObject = instance.GetType().InvokeMember(methodName, BindingFlags.InvokeMethod, null, instance, parameters);
That works just fine. But how do I subscribe to and handle events that are fired from a PowerPoint object using late binding? Can I use InvokeMethod and pass in a delegate? I have no idea.
Thanks in advance, you guys are the greatest!
Andy
|
|
|
|
|
You can subscribe to events through the same code you had posted. Look for add_XXX and remove_XXX methods, the compiler calls them for you when you use the += and -= operators.
Regards
Senthil
|
|
|
|
|
Hi,
I am planning to write a software which reads proxy servers from a txt file and connecting a site through a proxy server and clicking a link on the site. Can somebody draw a roadway to this software. I have C# experience but I don't know which subjects handled with this project???
Thank you,
Cem
|
|
|
|
|
Hi,
I have a byte array (guid) which I would like to represent as a string containing hexadecimal values.
(eg. 'A0FFE7...')
I have tried the System.Uri.HexEscape function which does calculates the correct values, but a '%' is set before each hexvalue (thus: %A0%FF%E7...) Trying to remove the '%' failed (probably because of some internal representation).
Is there a way how I can get the required result?
(I've looked in a guid object as wel, but couldn't find anything.)
tnx.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
If it's a GUID, simply call ToString(), that should do the job for you.
Regards
Senthil
|
|
|
|
|
Actually the byte[] is the GUID out of the database (no idea how they created it) In order to use this guid for queries I need the string representation of the bytes in hexadecimal form.
I did try the guid.ToString() both it didn't work.
Any other idea?
(if all else fails I can always go to the old fashion table .
tnx.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I am trying to update a relational record but not successful. Please help. Here is the code.
//// "Table" to "names".
OleDbDataAdapter da1 = new OleDbDataAdapter("Select * FROM Name",myConnection);
da1.TableMappings.Add("Table","Name");
da1.Fill(ds);
/// Fill the Dataset with Orders, map Default Tablename
OleDbDataAdapter da2 = new OleDbDataAdapter("SELECT * FROM Detail",myConnection);
da2.TableMappings.Add("Table","Detail");
da2.Fill(ds);
System.Data.DataRelation relCustOrd;
System.Data.DataColumn colMaster1;
System.Data.DataColumn colDetail1;
colMaster1 = ds.Tables["Name"].Columns["ID"];
colDetail1 = ds.Tables["Detail"].Columns["ID"];
relCustOrd = new System.Data.DataRelation("RelCustOrd",colMaster1,colDetail1);
ds.Relations.Add(relCustOrd);
da1.Update(ds, "Name");
da2.Update(ds, "Detail");
|
|
|
|
|
Hi msogun,
Iam able to work with the simillar code without any error. It will be very easy if you can send the error message.
Iam using the following code:
adptr = new SqlDataAdapter("select * from employees", connstring);
adptr.Fill(ds,"employees");
adptr2 = new SqlDataAdapter("select * from employeeadd",connstring);
adptr2.Fill(ds,"employeeadd");
DataColumn col1 = ds.Tables[0].Columns["empid"];
DataColumn col2 = ds.Tables[1].Columns["empid"];
ds.Relations.Add("Employee Address",col1,col2);
SqlCommandBuilder bldr1 = new SqlCommandBuilder(adptr);
bldr1.QuotePrefix = "[";
bldr1.QuoteSuffix = "]";
SqlCommandBuilder bldr2 = new SqlCommandBuilder(adptr2);
bldr2.QuotePrefix = "[";
bldr2.QuoteSuffix = "]";
adptr.Update(ds,"employees");
adptr2.Update(ds,"employeeadd");
Regards
SGS
|
|
|
|
|
Is there any way to create an AVIStream in memory?
without having to write to disk?
I’ve tried using the AVIStreamCreate function from avifil32.dll, but it keeps returning an error.
I need to capture video from a webcam, to a compressed avistream.
And then send the compressed stream over an LAN.
This is the code:
<br />
AVISTREAMINFOW aviStreamInfo = new AVISTREAMINFOW();<br />
<br />
aviStreamInfo.fccType = _fccType;<br />
aviStreamInfo.fccHandler = _fccHandler;<br />
aviStreamInfo.dwScale = 1;<br />
aviStreamInfo.dwRate = _frameRate;<br />
aviStreamInfo.dwSuggestedBufferSize = _height * _stride;<br />
aviStreamInfo.dwQuality = 0xffffffff;<br />
aviStreamInfo.rect_bottom = _height;<br />
aviStreamInfo.rect_right = _width;<br />
<br />
<br />
_result = AviFile.AVIStreamCreate(out _aviStream, 0, 0, ref aviStreamInfo);<br />
<br />
_result returns -2147221164
|
|
|
|
|
Most likely you're not properly marshalling these types, or are using incorrect types during the AVIStreamCreate method. 2 questions I would ask, is are you sure that _aviStream should be an out parameter instead of a ref (i.e. do you need to create it first?). Second question, what type is _aviStream? Windows Media SDK specifies it should be a pointer to a PAVISTREAM. Make sure you've marshalled this type correctly, it should be the address of a pointer to an IAVIStream interface.
After looking further at the MSDN documentation, I see Microsoft recommends "you should not need to call this function. Some functions, such as CreateEditableStream and AVIMakeCompressedStream, use it internally." You ought to use one of those methods instead.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Question 1.
I've tryed this
<br />
[DllImport("avifil32.dll")]<br />
public static extern int CreateEditableStream(out IntPtr ppsEditable, int psSource);<br />
<br />
private IntPtr _aviEditable;<br />
private IntPtr _aviEditableCompressed;<br />
<br />
_result = AviFile.CreateEditableStream(out _aviEditable, 0);<br />
<br />
if(_result != 0)<br />
{<br />
throw new AviException("Failed to create editable AVI stream.", _result);<br />
}<br />
And it returns an address (eg. no error)
So i don't think i need to create it first.
BUT! it wont do
<br />
AVICOMPRESSOPTIONS EditablecompressionOptions = new AVICOMPRESSOPTIONS();<br />
<br />
EditablecompressionOptions.fccType = _fccType;<br />
EditablecompressionOptions.fccHandler = _fccHandler;<br />
EditablecompressionOptions.lpFormat = new IntPtr(0);<br />
EditablecompressionOptions.lpParms = new IntPtr(0);<br />
<br />
_result = AviFile.AVIMakeCompressedStream(out _aviEditableCompressed, _aviEditable, ref EditablecompressionOptions, 0);<br />
<br />
if(_result != 0)<br />
{<br />
throw new AviException("Failed to create editable compressed AVI stream.", _result);<br />
}<br />
But, if it is a file based avistream it works
Question 2.
The _aviStream is IntPtr
|
|
|
|
|
Have you looked at this page? I see that it uses some of the functions we're talking about, maybe you can gain some understanding from it.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Yep....I know it.....It's the lib i use.
|
|
|
|
|