|
I stumbled onto my idiocy. I did not understand how BindingSource works. I did not realize it was a acting like an additional buffer, just as a DataAdapter does. I simply needed to throw in a BingSource.EndEdit() after my DataGridView.CommitEdit() and whala. I also, not only have a layer of indirection, but a buffer to validate before the real commit to the datasource.
|
|
|
|
|
hello! can anyone teach me how to transfer an audio file from one pc to another using udp? i've tried it myself by transferring the file by blocks however, when the transferring is done, the transferred file is not equivalent to the original file..maybe the some datagrams sent were not able to reach the destination.. how will i handle this?
mumwei
|
|
|
|
|
Hello,
I havent tried through UDP but I have successfully done through TCP packets.
System.IO.FileStream fstream = new System.IO.FileStream(files[j].FullName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
byte[] buffer = new byte[fstream.Length];
fstream.Read(buffer, 0, buffer.Length);
fstream.Close();
//writing to the network stream//
outStream = this.Client.GetStream();
for (int i = 0; i < buffer.Length; i++)
{
//outStream.Write(buffer, 0, buffer.Length);
outStream.WriteByte(buffer[i]);
}
outStream.Close();
You just need to transfer bytes.
Try this and tell me..
Regards ,
nishu
|
|
|
|
|
hi, at last somebody replied to my post..thanks. hmmm... would your recommendation be applicable to realtime audio streaming? my plan actually is to stream the audio packets in real time. since i don't know how to do that yet, i just tried to at least successfully transfer the audio file.yet unfortunately, i wasn't able to..
mumwei
|
|
|
|
|
Hello,
Yes @ clientside thread you receive and can directly play the audio.
Regards ,
nishu
|
|
|
|
|
Hello,
I test through iTunes.I received the bytes from iTunes and was success.
If you have any further question....keep posting..
Regards ,
nishu
|
|
|
|
|
thanks.. but can it handle transferring of way way too large audio files? as in audio files with a span of more than an hour?
mumwei
|
|
|
|
|
Hello,
Correct you should have seperate thread to transfer real time audio file to seperate clients.and you can transfer any length of file as long as your thread got terminate.
Regards ,
nishu
|
|
|
|
|
(If this is not the right forum for this question, please let me know which one).
I need to produce an xml like the following
<customer_list_data>
<customers>
<customer>
<customer_name detail="Customer_1"/>
<customer_status detail="active"/>
</customer>
<customer>
<customer_name detail="Customer_22"/>
<customer_status detail="inactive"/>
</customer>
</customers>
</customer_list_data>
(Notice one extra parent "customer_list_data" above. DataSet seems to have a problem reading in its xsd and properly identifying customer 'table'.)
for which the xsd is:
<xsd:schema targetNameSpace="customerbase"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="customerbase">
<xsd:element name="customers_list_data">
<xsd:complexType>
<xsd:all>
<xsd:element name="customers">
<xsd:complexType>
<xsd:all>
<xsd:element name="customer">
<xsd:complexType>
<xsd:all>
<xsd:element
name="customer_name" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="detail" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element
name="customer_status" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="detail" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
I need a list object in excel that would take user input for a list of:
customer_name, customer_status values.
Note that these correspond to the "detail" attributes of the above xsd, and
Not to the xml text elements.
Now I want to produce an XmlDocument that matches the above xsd, based on
the data filled by the user in the list object.
What is the best way to do that in [ C#, VSTO 2005 SE, Excel 2003 ] ?
Note: Ideally I want to use data binding using this xsd and want an
XmlDocument to be ready already when the user clicks a button in the excel
sheet. I do Not want to use strongly typed datasets.
-- modified at 19:20 Friday 16th February, 2007
|
|
|
|
|
DateTime dateDOB = rdr.GetDateTime(iDOBOrdinal);
It says this is an invalid cast.
When I do this:
DateTime dateDOB = DateTime.Parse(rdr.GetDateTime(iDOBOrdinal));
Is says no method Parse found.
How do I do this?
Thanks for your time!
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
It says that it's an invalid cast because you are not fetching a date from the database. What is the data type of the field that you are fetching the data from?
ExpertComing wrote: Is says no method Parse found.
Are you really sure that it's saying that there is no Parse method? I would rather expect it to say that there is no overload of the Parse method that takes a DateTime as a single parameter.
---
single minded; short sighted; long gone;
|
|
|
|
|
How can i remove a " from a string? i can't use IndexOf or any other function on it since it considers " a beginning of a string as a parameter, so...how can i remove a " from a string then? o_O
|
|
|
|
|
Use the Replace method, replace the " with an empty space.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
but i'm saying...you just can't, at the second you write " in VS it makes it like a beginning of a string, waiting for a closing "...
|
|
|
|
|
Oh, OK. YOu didn't make that clear. \" works, or if you use @ then "" works and \ otherwise means \. In a string like this:
"\\This\\is\\a\\string"
comes out as \This\is\a\string, because the \ is used as an escape character. If you put a @ at the front, then the \ just means \.
@"\This\is\a\string"
As you've been told, \" is how you specify quotes, quotes are the only thing that you can still specify in a @ string, with double quotes"
@"I have a single ""word"" in quotes"
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sharpiesharpie wrote: i can't use IndexOf or any other function on it since it considers " a beginning of a string as a parameter
Yes, you can, you just don't know how.
To put a quote character in a string you use double quotes. This is a string that contains a single quote character: """"
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Sorry, I gave you a VB solution.
But it really felt like a VB question...
In C# you use \" to put a quote inside a string.
---
single minded; short sighted; long gone;
|
|
|
|
|
You need to use the special escape sequences to specify a quote. To remove a quote use the following, assuming their is a string 'This is a "quote"' assigned to the variable str.
You would declare it as:
String str="\'\"This is a \"quote\"\'";
int index=str.indexof("\"");
Other escape sequences that can be used:
\n - newline
\" - double quote
\\ - backslash
\b - backspace
\t - tab
\r - carriage return
\' - single quote
These escape sequences were taken from my AP Programming book specifc to java, but I know most of them work with .NET languages if not all of them.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thank you! works just perfect !
|
|
|
|
|
Hi there,
I am trying to implement the recurring billing in the pfpro_dotnet_sdk_RC2_v1.1. I am not sure how to do it.
I need some serious help from you guys about this.
My development environment is C#, VS 2005 and pfpro_dotnet_sdk_RC2_v1.1(verisign sdk).
Thanks in advance.
Regards
Nabhendu
|
|
|
|
|
Biplab saha wrote: I need some serious help from you guys about this.
Maybe if you detailed your problem, someone may be able to help you more.
However, this is not a PayPal support forum and PayPal have a support ticket system, online doccumentation, API reference and knowledge base.
This can all be found here: https://www.paypal.com/IntegrationCenter/ic_payflowsdk.html
With a community forum here: http://www.pdncommunity.com/
Not bad work considering I don't know anything about pfpro_dotnet_sdk_RC2_v1.1
The power of Google, you may want to try? --or-- at least post a question in the formum dedicated to the product
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hello,
how it is possible to register and then get the message WM_DWMWINDOWMAXIMIZEDCHANGE?
On http://blogs.msdn.com/greg_schechter/archive/2006/09/14/753605.aspx I have found this information:
WM_DWMWINDOWMAXIMIZEDCHANGE - windows can register to hear about when other windows have been maximized. This is useful for, for instance, the TaskBar or the SideBar which go opaque when other windows get maximized.
The following code will not detect the message WM_DWMWINDOWMAXIMIZEDCHANGE but the other messages like WM_DWMCOLORIZATIONCOLORCHANGED will be detected. (Desktop compositing is enabled and the following code is in a simple windows form created by vs2005)
private const int WM_DWMCOMPOSITIONCHANGED = 0x031E;
private const int WM_DWMNCRENDERINGCHANGED = 0x031F;
private const int WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320;
private const int WM_DWMWINDOWMAXIMIZEDCHANGE = 0x0321;
protected override void WndProc(ref Message msg)
{
if (msg.Msg == WM_DWMWINDOWMAXIMIZEDCHANGE)
{
}
base.WndProc(ref msg);
}
May you have some information how register and detect this message...
Regards michi
-- modified at 6:35 Saturday 17th February, 2007
|
|
|
|
|
Im trying to take every pixel in a Bitmap and save it in bye array.... Buit Im getting a n error
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt"
Can any1 tell me wht wrong with this code
<br />
public static byte[] check(Bitmap b)<br />
{<br />
BitmapData bmData<br />
= b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadOnly,PixelFormat.Format24bppRgb);<br />
int stride = bmData.Stride;<br />
byte[] bytes = new byte[stride * b.Height];<br />
System.IntPtr Scan0 = bmData.Scan0;<br />
unsafe<br />
{<br />
int a = 0;<br />
byte* p = (byte*)(void*)Scan0;<br />
int nOffset = stride - b.Width * 3;<br />
int nWidth = b.Width * 3;<br />
for (int y = 0; y < b.Height; ++y)<br />
{<br />
for (int x = 0; x < nWidth; ++x)<br />
{<br />
<br />
bytes[a] = p[0];<br />
a++;<br />
Here I got the error-> bytes[a] = p[1];<br />
a++;<br />
bytes[a] = p[2];<br />
a++;<br />
p += 3;<br />
<br />
}<br />
p += nOffset;<br />
}<br />
}<br />
b.UnlockBits(bmData);<br />
return bytes;<br />
}<br />
<br />
|
|
|
|
|
Read my image processing articles. You're stepping over the scanline into the stride area.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|