|
arkiboys wrote: I can see \r\n in the text but these signs are not imported into the table field which is of type varchar(max).
Yes they are, its just you dont see them as \r\n - they're non-printing characters so they dont display in the database - but I assure you they're there.
You have 2 options
1) Make the replacement when uploading the data
2) Make the replacement when retrieving data
take your pick.
|
|
|
|
|
In immedia window:
"---- 2008 ----\r\n\r\nsome text here"
In output window:
---- 2008 ----
some text here
in sql server table:
---- 2008 ---- some text here
|
|
|
|
|
Was that supposed to tell me something?
|
|
|
|
|
Sorry,
The idea is to get the same result into the sql field as the one in the output window.
|
|
|
|
|
Hello Friends,
I have a requirement of my application to know when user select a value on crystal report and getting the selected value from crystal report view to my .net application and using that value set data to be drill down.
Kindly help me how can I get the selected value from crystal report view to my application.
Thanks in advance
Regards
|
|
|
|
|
hi,
kindly let me know that, how to add Icon file / JPG file into Cell using DataGridView?
Thankx in advance
(Riaz)
|
|
|
|
|
Use image column.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
hello
having problem trying to unregister remoting channel (.NET 2.0/XP) - error:
<br />
System.Net.Sockets.SocketException : Only one usage of each socket address (protocol/network address/port) is normally permitted<br />
On server side, I created the channel by:
<br />
TcpChannel oTcpChannel = new TcpChannel(AppContext.DefaultRemotingInterfacePort); ChannelServices.RegisterChannel(oTcpChannel, true);<br />
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Util.MyRemoteObj, "TcpRemoteObj", WellKnownObjectMode.Singleton);<br />
Then I try to close and restart channel (as part of application re-initialization rountine - this means process never actually exited and that would be undesirable)
<br />
ChannelServices.UnregisterChannel(oChannel);<br />
TcpChannel oChTcp = (TcpChannel)oChannel; oChTcp.StopListening(null);<br />
I have no clue how to get around this at the moment - I Googled a bit seems like many people are running into this problem but no solution yet. Many suspected OS (or .NET) failed to release socket on UnregisterChannel until application/process exit. But I don't want to exit the app, just want to reinitialize remoting as part of re-init routine.
Any suggestion? Many thanks!
dev
|
|
|
|
|
i am making a program wherein i have a replica of a keyboard. The user will tap any key on the keyboard on what he would like to type. He can select the input language to English,Japanese Hiragana and Japanese Katakana. I'm using Sendkey.Sendwait to send the character tapped by the user to the textbox. My problem is when I select Hiragana or Katakana for the input language and type, sometimes the characters that I type will disappear. It will appear when the user will tap again a key to the keyboard. Please help me...
below is a snippet of my code...this will just display the alphabets...when the letter is tap...
if (m_LastStr!=null && m_LastStr.EndsWith(" ")) // added for the correction asked by anand
{
SendKeys.SendWait(m_LastStr + "\n");
SendKeys.Flush();
m_LastStr = null;
}
if (((Button)sender).Text[0] > 'A' && ((Button)sender).Text[0] < 'Z') // to handle shift effect
{
m_LastStr = m_LastStr + ((Button)sender).Text.ToLower();
SendKeys.SendWait(m_LastStr);
}
else
{
m_LastStr = m_LastStr + ((Button)sender).Text;
SendKeys.SendWait(m_LastStr);
}
SendKeys.Flush();
|
|
|
|
|
How to generate XML report using SQL Server Reporting Services?
|
|
|
|
|
|
|
I am working with Digital Elevation Models, and some of these are very large and very slow to access.
The files currently are in text format 10,000 rows and 8000 columns , and I was considering that as all items the file contains are positive numbers (ranging from 0 being sealevel to 4000 being highest peak) there must be a much better format to store these for file size and access speed.
What would you suggest as the best file format for this -two bytes for each number, or singles, or doubles or....? The key thing is fast access to the array of data in the file.
Thanks for any suggestions.
|
|
|
|
|
Hi,
a binary file will provide access much much faster than anything text-oriented.
use BinaryWriter/BinaryReader for this.
Warnings with binary files:
- you are responsible for consistent file contents; from the outside, it looks like just a collection of bytes, there is no way to recognize its structure;
- portability is limited to systems that have the exact same data representation; e.g. x86 stores multibyte values in "little-endian" mode (least sighificant byte first), other systems may use
"big-endian" hence not correctly interpret the same file.
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
modified on Friday, June 10, 2011 12:27 PM
|
|
|
|
|
Binary, as Luc said. And you should probably use short (Int16) values.
Also, can you read and write a group of them at a time?
|
|
|
|
|
For the simplest code you could use two bytes for each value:
value = data[0] + data[1] * 256;
You only need 12 bits to store each value (0 to 4095), so for the smallest file size you could pack two values in three bytes:
Bit usage:
11111111 11112222 22222222
pack:
data[0] = (byte)value1;<br />
data[1] = (byte)(((value1 >> 8) << 4) + (value2 & 15));<br />
data[2] = (byte)(value2 >> 4);
unpack:
value1 = data[0] + ((data[1] >> 4) << 8);<br />
value2 = (data[1] & 15) + (data[2] << 4);
Despite everything, the person most likely to be fooling you next is yourself.
modified on Wednesday, January 14, 2009 12:34 AM
|
|
|
|
|
As people have mentioned, binary packed 16 bits per datapoint. Keep in mind your raw data is around 150MB.
You could have a fiddle with the Bitmap classes if you are uncomfortable with packing data yourself - treating them as a heightmap. May give performance benefits if GDI doesnt have a problem with the image size.
|
|
|
|
|
Thanks all for the suggestions, the bitmap idea could be very helpful as it would maintain the structure of the file.
I don't know if the code to get a pixel value from a bitmap is efficient. As the file only has to be created once write speed is not relevent, but read time critical.
|
|
|
|
|
Reanalyse wrote: Smallest and fastest way
Usually the two requirements go in the opposite direction.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I am trying to use an ActiveX object in my c# application. The ActiveX object is installed in my pc and works properly in my c++ application. but when i tried to drag and drop the ocx from the toolbox to a winform in my c# application, an error poped up and said the ocx wasn't registered properly. so i tried to use reflection for dynamically innovating it't members and properties.
firstly, i created a class inherited from AxHost.
The type of ocx has been created as follow:
ocxType = Type.GetTypeFromCLSID(new Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx")); // guid of the ocx object registered in my pc
then in order to use the methods of this ocx, i used Type.Invokemember to do the job.
ocxType.InvokeMember("MethodName", BindingFlags.InvokeMethod, null, this.GetOcx(), null); // "MethodName" is coming from the description documtation of the ocx object
I tested the program and it executed successfully.
However, when i tried to invoke the properties, unknown name exception was thrown all the time. but what confused me the most is that invoking the event in this way seemed not working at all.
so here are my questions:
what is the proper way to use the Ocx object in C# application?
Are there any disadvantages of invoking members of ocx in this way?
How can I bind all the information including event?
Thank you soo much for all the help,
angral
modified on Tuesday, January 13, 2009 8:59 PM
|
|
|
|
|
I am not at all sure that this will cure your problems, but a long time ago I had troubles using an ActiveX object. If my memory serves I used the VS commandline tool 'aximp'.
While you are waiting for someone who really knows what to do, you might look up the help for this tool.
Sorry I couldn't be more help.
Henry Minute
If you open a can of worms, any viable solution *MUST* involve a larger can.
|
|
|
|
|
Thanks Henry,
that AXIMP.exe is a very handy tool.
I will experiment it right away.
Cheers
angral
|
|
|
|
|
Is there a way to insert a video\animation into a c# application that is officially supported by the .net framework (meaning I won't be dependent on a third-party component)?
|
|
|
|
|
|
Hi All,
Im currently studying the asp.net tutorials for Data access . Ie datasets, datatables and SQL stuff as per the following link.
http://www.asp.net/learn/data-access/tutorial-01-cs.aspx[^]
However I find that much of the tutorials centre on using the help wizard to do things for you rather than being able to hard code it yourself.
Does someone know of any other sites which enables you to learn the above by hard coding rather than relying on the wizard. Thanks
Best Regards
modified on Tuesday, January 13, 2009 7:54 PM
|
|
|
|