|
Make sure your class is decorated with "public".
Also, you may try to move it in App_Code folder.
Calin
|
|
|
|
|
is there is any free pivot chart Controller for visual studio
Dushan Perera
|
|
|
|
|
Hi Team,
Required functional is to access the Base class Method itself on other hierarchy class but need to restrict the base class method on derive class.
For Example,
Base Class B --------> Having Static Method M
Derive D from B
Need to restrict the access of Method M through D but should be accessible through B.
Can anybody help me out.
Thanks in Advance
Tarun Singh
|
|
|
|
|
maybe use the sealed keyword, im not sure thou
no, dont think so lol... try 'explicit' keyword instead
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
explicit is for overloading conversion operators.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
No, Not Fulfill the functionality.
|
|
|
|
|
Not sure you can.
The best I can think of is to mark D's M as internal new , that way it won't be visible outside that particular assembly but B's M will.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
One way I can see doing this is by adding a level of hierarchy,
Base Class B
Derived Class B_With_M
Derived Class D
All other classes whom you want to give access to M will derive from B_With_M and not from B.
|
|
|
|
|
Hello,
when reading a text file, the letters having accents, they appear square caps in a message box, how can we keep the same letters? thank you verry much.
|
|
|
|
|
its down to the encoding of the text, as far as i know you cant change that with the message box directly but maybe it can be set in the system
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Hi,
Most probably the MessageBox is not at fault, the way you read your file is.
each text file uses some way to identify characters that are outside the regular ASCII character set
(which is less than 128 chars). You either use a "code page" telling what the byte values [128,255]
represent, or some more elaborate scheme such as UTF8 or Unicode, to get access to a much larger
character set where some or all characters use 2 bytes.
UTF8 and Unicode files start with a special byte sequence to identify them. When no byte sequence
is present, your best guess may be to use the code page that suits your locale; I typically use
new Encoding(1252) yielding a West-European code page.
So when reading a text file, you should apply the right "encoding" and pass that to your
input methods, e.g. File.ReadAllText Method (String, Encoding)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:00 AM
|
|
|
|
|
Hello,
i encode the word file using this code :
Convert.ToBase64String(data) ,
but when i decode the code 64digits, we mus add an extention like .doc, can we know the extention of code base 64 digits? thank you verry mutch.
|
|
|
|
|
if it is a data file i think you would need to check the file header information and determine the filetype from that then choose you extension, this however would mean you need to have a list of file associations for different filetypes. You best option might be to store the extension somewhere before conversion if that is posible?
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
If I understand correctly, then no you can't. Encoding a word file (or any file) for that matter to base64 just stores the raw data of the file, not the name or extension or file data.
Regards,
Rob Philpott.
|
|
|
|
|
so we can't get the extension of the original file?? i don't like save the extension elonely in another filed, thank you verry mutch
|
|
|
|
|
Hi,
if you are creating an app that does Base64 file conversion, you have several options:
1. you could generate a file that has the original filename and append "64" to the extension;
2. you could generate a file that holds at least two strings, the first being the filename+extension,
the next one being the base64-encoded data.
BTW: I hope you are not reading all the data first, then turning that into a single (possibly huge) string. If you were to do so, a large word document (one that Word your barely manages to open on
your system) would not fit in your conversion app since that would have to hold both the original
and the converted data (which is 33% larger in size). The right way is to have a loop reading
say 64KB of data and outputting that in base64, then repeat until all is done.
[ADDED]
if you are storing binary file data in a database, I suggest you use two fields, one for the
filename, one for the data.
[/ADDED]
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Thursday, February 12, 2009 11:49 AM
modified on Sunday, June 12, 2011 8:01 AM
|
|
|
|
|
Hello,
i find an exemple to generate a word file, so i don't understand this code,
for (int i = 1; i <= Doc.Bookmarks.Count; i++)<br />
{<br />
object index = i;<br />
Microsoft.Office.Interop.Word.Bookmark bk = Doc.Bookmarks.get_Item(ref index);<br />
Bks.Add(bk.Name, bk.Range);<br />
}<br />
<br />
((Microsoft.Office.Interop.Word.Range)Bks[s]).InsertAfter(????);
in the model of my word file, it's name is MODEL.dot, they are thie sentence "test", but when i make this
((Microsoft.Office.Interop.Word.Range)Bks[s]).InsertAfter("test"); , there are an exception :
Object reference not set to an instance of an object.
Thank you verry mutch.
|
|
|
|
|
Hi,
I have added a category column to my Sharepoint document store. I want to create a web application that will allow users to search for documents based on the value of this category.
I have looked at the various articles here at CodeProject and I can't see anything that suits.
Can someone point me in the direction of how to achieve this in C#/ASP.NET?
Thanks
|
|
|
|
|
you may use the lists.asmx (webservice) from your sharepoint website.
Something like: in this article[^]
Also, you may use something like list.Attributes["CATEGORY_COLUMN"].Value to get the value for your custom column.
Calin
|
|
|
|
|
Hi,
I´d like to select DataRows with an Id and a Date, but I always get the following Error-Message:
Cannot perform '=' operation on System.DateTime and System.String.
Here my Code:
string BehID = data1.Behandlungen.Rows.Count.ToString();
string datum = microsim1["picdate"].ToString();
DataRow[] VerlaufDatum = data1.Verlauf.Select("BehandlungsID=" + BehID + " AND Datum= '" + datum + "'");
It worked perfectly witch Visual Studio 2003, but with Visual Studio 2008 I always get this Exception
thanks for your help.
|
|
|
|
|
im suprised it worked in any version
youor trying to compare a string to a dateTime which clearly is not the same type
As the BehID is unique why use the datum value at all?
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Hi,
Try to create a DateTime object from
datum , to see if you have a valid data format in that string.
Calin
|
|
|
|
|
I already tried to create a DateTime Object from
datum
and the Cast worked perfectly, but there occurs the same Exception when I edit the Code as follows:
DataRow[] VerlaufDatum = data1.Verlauf.Select("BehandlungsID=" + BehID + " AND Datum= '" + Convert.ToDateTime(datum) + "'");
I think it has something to do with the '=' Operator, but I don´t know what´s wrong with it
|
|
|
|
|
Try by formatting the date and pass this string:
"#" + dt.Month + "/" + dt.Day + "/" + dt.Year + "#"
Calin
|
|
|
|
|
You need to convert one or both sides of your statement so that they are both the same data type. A string type and a datetime type are incompatible, so find a way to collect the datetime information contained in your string explicitly and use DateTime.Parse to make it compatible.
|
|
|
|