|
thanks for your reply..
I'm not aware of sql parser in .net.. Could you please tell me how can i get it so that I can test the same with DB2 also..
Thanks in advance
|
|
|
|
|
The parser is not a .net feature, it's a sql server feature - SET NOEXEC ON. By doing this, when you execute your sql it simply parses but does not execute. I don't know if db2 has a similar feature?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Does anyone know how I can encode a string to a CP865 encoded text, (not for example Unicode or UTF8).
What I am trying to do is to transfer a string content as an txt file with CP865 encodeing.
Response.ClearContent();
Response.AddHeader("Content-disposition", "Attachment;filename=Myfile.txt");
Response.ContentType = "text/plain";
Response.Write("This text shall have de Norwegian charset of the CP865 encoder");
Response.End();
Thanks
Thomas
|
|
|
|
|
You can convert to a specific codepage using the Encoder class:
byte[] bytes = Encoding.GetEncoding(865).GetBytes("This text shall have de Norwegian charset of the CP865 encoder");
You may also need to specify the encoding in your response header.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks, it worked great
Here's a example of my final solution, if anyone else ever needs it.
int chunkSize = 10000;
MemoryStream ms = null;
int dataLeft = 0;
try
{
Response.ClearContent();
Response.AddHeader("Content-disposition", "Attachment;filename=Myfile.txt");
Response.ContentType = "text/plain";
byte[] bytes = System.Text.Encoding.GetEncoding(865).GetBytes("This text shall have de Norwegian charset of the CP865 encoder");
dataLeft = bytes.Length;
ms = new MemoryStream(bytes);
while (dataLeft > 0 && Response.IsClientConnected)
{
byte[] currentChunk = new byte[chunkSize];
int currentChunkSize = ms.Read(currentChunk, 0, chunkSize);
Response.BinaryWrite(currentChunk);
dataLeft -= currentChunkSize;
currentChunk = null;
}
Response.End();
}
catch{}
finally
{
if (ms != null) ms.Close();
ms = null;
}
|
|
|
|
|
I'm trying to create a class that will dynamically load an assembly that will
hold a several definitions for structs (used as an interface to an existing application).
My class will then display those structs as strings - display the interface.
I need to load it dynamically since there are several versions of the same interface.
Thx.
|
|
|
|
|
Thats nice. What is the problem you are experiencing?
|
|
|
|
|
How do i do that ?
I know how to display the struct layout.
I know how to load dynamically the assembly.
Let me try and explain my problem:
lets say that i have a class A which can display type S as a string.
S is defined in class B.
I have to reference B or else i get a compilation problem.
but, since B has two versions (1 and 2) i want to load it dynamically.
how do i do that ?
|
|
|
|
|
Nir sheffi wrote: how do i do that ?
Your problem is not very specific. Maybe you need to rethink the design and focus on smaller problem areas.
|
|
|
|
|
but this is my problem !
i want to display a struct that changes between versions of assemblies.
|
|
|
|
|
Nir sheffi wrote: but this is my problem !
i want to display a struct that changes between versions of assemblies.
So what is the problem?
- Does it not load?
- Can you not differenciate between 2 versions of the same type?
- Do you get an exception when you do something?
- Anything else?
|
|
|
|
|
class A
{
void print(B b){....}; // prints type B
}
struct B (ver 1.0)
{
int x;
}
struct B (ver 2.0)
{
int x;
int y;
}
if A does not ref. directly to assembly that holds B we can not compile since A does not know B.
but i want to load B dynamically, so i do not want to ref. B during compilation.
that is my problem.
|
|
|
|
|
Hi everyone!!!
Is there anyone who knows how to retrive photos in the active directory using c#?
|
|
|
|
|
u Can Start Here in CodeProject
[^]
Have Fun
Never forget it
|
|
|
|
|
Hello,
I use the smtp and the System.Web.Mail namespace to send mail to Hotmail and Yahoo servers but I receive a failure message int Inetpub\mailroot\Badmail folder from hotmail server But I don't know why.
Thanks.
Dad
|
|
|
|
|
You have to have a hotmail account. You need to ask hotmail for their correct smtp settings in order to use their servers to send mail. If you have an account, and you think you have the correct settings, you should try asking in the hotmail forums, or sending an email to their support team.
Simon
|
|
|
|
|
Hello, I want to show two date value(starting date, end date) on top of my Crystal report
like this( From: 07-07-08 to To: 08-07-08). I select these two date in another form. Now how can I send this two parameter in my crystal report and print on top left of my report?
Can any 1 help plz??
|
|
|
|
|
Hi All,
I have a text box i dont want to user eneters here anything apart from character..
so is there any property exist here to validate automatically...
or i have to do it on textchange event ...
vikas da
|
|
|
|
|
No, for a normal text box you have to use an event to filter it. You could use the text changed event, or you could use the key press events and filter out any keys you don't want to accept. (This wouldn't stop them pasting into the text box though, so you should probably validate the whole block of text when the dialog was confirmed too.) Don't forget to not block the backspace/delete/arrow keys if you do this.
Simon
|
|
|
|
|
Thank alot for your reply.. i am trying the same now what you have been suggested....
vikas da
|
|
|
|
|
Use Validating event to validate the contents and cancel the event if required. This event will be fired when user moves focus out of the textbox, even pressing the ok button would trigger this event.
So, use this event to check if the text of the textbox is ok or not.
Nirandas,
a developer from India.
http://www.nirandas.com
|
|
|
|
|
Hi All,
I have 10 textboxes, with different lables,
during creating the text boxes i just do copy paste and didnt remeber to follow the sequence ..
now i am facing the problem here after loading the form when i am filling the values in the form ...am nevigating from one textbox to other using tab ... but its not working good ...means its going to first textbox then third then fifth as was copied so how can i make all this in order...
Thanks alot..
vikas da
|
|
|
|
|
When you are in the design view of the form, select the Tab Order item of the menu View to fix the sequence.
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]
|
|
|
|
|
Thanks alot ... it is done since i am using VS2008 so it is called here as tab order...
vikas da
|
|
|
|
|
thanks alot i got tab order also... this is nice
vikas da
|
|
|
|