|
|
Good afternoon
XmlTextReader behaves very strange: I have the following
encoding-definition in my (valid) XML-File:
encoding="ISO-8859-1"
If I open the File:
fileStream = new StreamReader (xmlFile);<br />
xmlReader = new XmlTextReader(fileStream);
an read some values, I can see that the Encoding is set
to "UTF-16" and I don't get all data: XmlTextReader
absorbs non UTF-16 characters.
If I explicit define the Stream-Encoding to:
fileStream = new StreamReader(xmlFile, <br />
Encoding.GetEncoding("ISO-8859-1"));
then XmlTextReader works perfect.
Is it wrong to except that XmlTextReader relates it's encoding
to the XML-Definition and not to the stream encoding?
Or: Do I really have to open the xml-file to check the
encoding-property and then to open the xml-file
again using the right stream - encoding?
Thanks a lot for any hint in advance,
kind regards,
thomas
People who wait until the eleventh hour to call on Jesus die at 10:30.
|
|
|
|
|
Hi,
I have a form containing just a Microsoft WebBrowser Object. Im using it to view Excel files in my app (workaround for no OLE support). Only problem is, the controls take a long time to load, so I'm trying to get them to initialize in another thread when the app begins. There are two stages to the init of one such form: the constructor, where the activex control is inited, and the View() command, which causes the control to navigate to the specified file.
I've found that if I call View() straight after calling the constructor, the control freezes and Excel shows an "Out of memory" error box. However, if I move the View() call to when a user presses a button, for example, it works perfectly. It's somewhat strange, and i cant find any events that tell me when the control is finished initing. Can anyone help me please?
Thanks in advance
Mankeyrabbit
|
|
|
|
|
Hi,
I have created an dll Using .NET framework 2 (Beta 2) with CLR option off
(as my underlying implementation is C++).
1. Now when I am trying to deploy this on a machine which has just .NET framework 2 redistributable on it. I get error while registering this dll there.
I have kept Manifest generation and embed manifest options ON.
2. When I switch them (Manifest) OFF : It works fine, gets registered on that machine.
But on system with .NET framework 2 intalled and having XP, it fails to register...
Any suggestion why this must be happening..
thanks & regards
ajay
|
|
|
|
|
i have confusion that About CLR Memory Allocation / De-Allocation:
That if an managed class written in VC++.Net:
For e.g:
__gc class Client1
{
public:
Client1()
{
}
~Client1()
{
}
static double Square (double value )
{
value = value * value;
Console::WriteLine("Client1 Returning {0}",__box(value));
return value;
}
};
and i try to allocate it's instance as:
(1): Client1 * cl1 = new Client1();
and do not explictly delete it , then is it posssible that this instance will automatically be deleted by <CLR> of .Net?
-----------------------------------------------------------------------------
(2): An other confusion i have is that if i allocate an array of
<Client1> type objects such as:
Client1 * cl[] = new Client1 * [3];
will this instance will automatically be deleted by CLR or it also have to
explicitly destroyed using syntax < delete []cl; >
-----------------------------------------------------------------------------
(3): I create an delegate in VC++.Net
__delegate double Square(double);
use it in <_tmain> as:
Square * sq1 = new Square(0,&Client1::Square);
sq1->Invoke(3);
will the instance of this <sq1> delegate type object will be
deleted automatically by CLR or not?
|
|
|
|
|
in Managed code GC control all of these de-allocations automatically
,actually GC check them periodically and collect everyone of them that
ain't used.
.Net Developer
|
|
|
|
|
Hi everybody I hope somebody can find a suggestion for this problem
I wrote store proc that work correctly in QueryAnalyzer but when I
call it from my project it make error "system error"
look at it:
CREATE PROCEDURE spSer_contact
@contactGroupID uniqueidentifier,
@countryID uniqueidentifier,
@contactName varchar(100),
@city varchar(50),
@phoneNumber varchar(100)
AS
declare @SqlString varchar(2000)
set @SqlString = 'SELECT contact.contactName,
contactgroup.contactGroupName,
country.countryName, contact.city,
contact.street, contact.zipCode,
contact.phoneNumber, contact.faxNumber,
contact.telex, contact.email,
contact.webSite, contact.comments,
contact.attachment,contact.contactID,
contact.contactGroupID, contact.countryID
FROM contact INNER JOIN contactgroup
ON contact.contactGroupID = contactgroup.contactGroupID
INNER JOIN country
ON contact.countryID = country.countryID
WHERE'
if (len(cast(@contactGroupID as varchar(38))) != 0)
set @SqlString=@SqlString+' contact.contactGroupID='''+cast (@contactGroupID as varchar(38))+''''
if (len(cast(@countryID as varchar(38))) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString = @SqlString + ' contact.countryID = '''+cast(@countryID as varchar(38))+''''
else
set @SqlString = @SqlString + ' and contact.countryID = '''+cast(@countryID as varchar(38))+''''
if (len(@contactName) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString=@SqlString+' dbo.contact.contactName='''+ @contactName+''''
else
set @SqlString=@SqlString+' and dbo.contact.countryID= '''+ @contactName+''''
if (len(@city) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString = @SqlString + ' dbo.contact.city = '''+@city+''''
else
set @SqlString = @SqlString + ' and dbo.contact.city = '''+@city+''''
if (len(@phoneNumber) != 0)
if (SubString(@SqlString, len(@SqlString) - 4, 5) = 'where')
set @SqlString=@SqlString+' dbo.contact.phoneNumber= '''+ @phoneNumber+''''
else
set @SqlString=@SqlString+' and dbo.contact.phoneNumber= '''+ @phoneNumber+''''
exec (@SqlString)
GO
====================
//sample code for retriving data by store proc
SqlConnection cn = new SqlConnection(connectionString);
SqlCommand cm = new SqlCommand("[spSer_contact]",cn);
cm.CommandType = CommandType.StoredProcedure;
SqlParameter pm = new SqlParameter("@contactGroupID",SqlDbType.UniqueIdentifier,16,"contactGroupID");
pm.Value = listBox1.SelectedValue;
cm.Parameters.Add(pm);
SqlDataAdapter da = new SqlDataAdapter(cm);
DataSet ds = new DataSet();
da.Fill(ds,"contact");//this have problem error message is (system error)
dataGrid1.DataSource = ds.Tables["contact"];
if somebody find a solution for this problem please send it
thanx
|
|
|
|
|
how can i export .Net Native data types such as for e.g [string]
to a calling C# program ?
|
|
|
|
|
4 of the (essentially) same questions all in a row...was it really necessary?
|
|
|
|
|
how can i export .Net Native data types such as for e.g <string>
to a calling C# program ?
|
|
|
|
|
|
Is there any proper way of returning string from a function in a DLL ,
written in VC++.Net to the calling C# program.
plz i need this solution urgently....................
|
|
|
|
|
C# strings are unicode, so perhaps you need to return a BSTR ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What is the proper way of calling code written in VC.Net from C#
|
|
|
|
|
As You know in vc.net you can write managed and unmanaged code
Unmanage Code:
if you want to use unmanaged code use platform invoke
P/Invoke to call function you have in dll
Managed Code:
you can compile your code and reference this assembly from your project
MCAD
|
|
|
|
|
Don't know if this is right to chip into your current topic or should I start a new one BUT....
There are functions in C++ like
"CVideoModes:CurrentVideoMode(CurrentMode)" that do not exist ( or I can't find them!)in C# in the .NET framework.
Where can I read more about imbedding C++ code in a C# program?
Wej Parry
|
|
|
|
|
|
Thank you Mohamad. Spot on answer. I obviously have a lot to read and understand.
Wej Parry
Wej Parry
|
|
|
|
|
Ok guys, i not even know if it's a problem but i've seen many c# tutorials that explain assembly compilation by command line and i've seen they usually use "csc (my arguments...)".
That "csc" is a bit strange for me because they only use csc directly("c:\>csc myarguments..." for example) but i have to type all the path to the csc.exe file (C:\Windows\Microsoft.NET...csc.exe Myarguments...).
How can i create a link to csc?
Thanks in advance
|
|
|
|
|
Create a .txt file, open it and paste %comspec% /k "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat" (or something else, go to Start->All Programs->Microsoft Visual Studio .Net 200X->Visual Studio Tools->Right-Click Command Prompt->Properties->Target->Paste that line)
Save the text file, and rename it to .bat, Now you can doubleclick and you have a shortcut to all Visual Studio programs, you can just type csc and the command prompt knows what you mean.
Mazzelz!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Hi All,
I have a custom datagrid with two checkbox controls in it.
When checkboxA is checked then if checkboxB is checked, it is unchecked and vice versa. (not like a radio button since if checkboxA is unchecked then nothing happens to checkboxB).
But I would like to implement this in client side...any help would be GREATLY appreciated!
schoudhr@hotmail.com
|
|
|
|
|
I am looking for some type of package that offers a task management system to allow us to track tasks, create reports.. within our portal? Is there anything out there that is any good?
|
|
|
|
|
Take a look at www.axosoft.com.
|
|
|
|
|
I am looking for something that will not only support software teams but also teams outside of software development.
|
|
|
|
|
I am Programming for a Desktop File Search Software in Pocket 2003.
I use .NET CF.
How Can I Get Text from A Pocket Office File?
Please Help Me,Thank !
zzzzzzz
|
|
|
|