|
char c = (int)65;
c is now "A".
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi !
sorry for my bad english
So...
How can i give the encoding format (UTF-7/8/16) .
I'm testing with a Word Document.
Thanks in advance
Alex
|
|
|
|
|
hi
System.Text
1. UTF8Encoding
2. UFT7Encoding
3. ASCIIEncoding
3. UnicodeEncoding
These class can be used to encode the text as we require.
Hope this will help u in some way.
Regards
|
|
|
|
|
thanks 
|
|
|
|
|
i want to use a query builer in my project, as well as SQL Server`s query analyser that with it, i can biuld and analys my desire query at run time for my report generator.
thanks.
|
|
|
|
|
Then use google[^] to search for articles. No one answered you last time, save myself since you actually didn't ask a question (just stated a purpose). There many be articles here on CodeProject as well.
It's definitley not a simple solution and requires a lot of understanding about parsing and graphics. There may be commercial libraries as well. Just search.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
A colleague of mine tried to buil a SQL query parser/builder, and succeeded, as long as the queries were simple. As soon as you dive into nested queries, the nightmare begins. I think one of the reasons a lot of database servers are so expensive is probably because it took an enormous amount of time to create a fast enough query parser. And to make a query builder, in a puristic way of seeing things, would require understanding of how the resulting query would be parsed....
|
|
|
|
|
Hi,
Can anyone tell me about using DllImport in C# ? Why and How ?
Thanks in advance
Deeps..
|
|
|
|
|
The DllImport attribute is mainly used for P/Invoke calls (that is, calls to legacy functions, like Win32 API, old DLLs you've got lying about, etc.) There's loads of sites out there that will give you some useful examples (as well as how to deal with some of the gnarlier C-style structures you're sure to encounter), but here's a quick-and-dirty example:
namespace bob {
public class GarbageClass {
[DllImport("Kernel32.dll")]
public static extern bool WriteProcessMemory(
IntPtr hProcess, IntPtr lpBaseAddress,
IntPtr lpBuffer, int nSize,
out int lpNumberOfBytesWritten );
....class omitted....
}
}
This is the declaration for the Windows API call
BOOL WriteProcessMemory( HANDLE hProcess, LPVOID lpBaseAddress,
LPCVOID lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten)
Welcome to the world of P/Invoke
Jeremy Kimball
I have traveled the gutters, lo these many days, with no signs of life. Well met.
-brianwelsch
|
|
|
|
|
If you want to know more information than what Jeremy gave you, I suggest you thoroughly read the documentation.
Read Consuming Unmanaged DLL Functions[^] and Marshaling Data with Platform Invoke[^] in the .NET Framework SDK.
For information specific to the DllImportAttribute , you can read about that[^] in the class library documentation in the .NET Framework SDK.
Be sure you read about it. Just guessing leads to many problems, especially since when you marshal data between managed and unmanaged code, the bit-widths of data types must be the same (like an unmanaged LONG is actually a managed long (Int64 )). Having experience with native code (i.e., C/C++) will definitely be helpful.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi
Is it possible to include an XML document in a Reource File?
If yes, pls help me with sample codes.
Regards
ganesh
|
|
|
|
|
Anything can be an embedded resource. Add the XML document to your project, right-click and select Properties. In the PropertyGrid, change the Build Action to Embedded Resource.
Use Assembly.GetManifestResourceStream to pull it out. The root namespace of the project (in the project settings) plus any folders in which an emedded resource is located comprise it's "namespace" (as well as the default namespace for source files, though you can override this after the file is created).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Friends
I Get some Problems on datagrid.. I want to make it multiple column selection. I did it by handling all the painting. But the painting fails when some Columns are partially displayed(Hopes u can understand, if not pls Ask.)
So if anyboady knows How to check a column fully visible pls help me
Thanks in Advance
bye
Krishnadevan
If u can Dream... U can do it..
|
|
|
|
|
When you're drawing your column, check the DataGrid.Right property. If it's less than your column's right side, then subtract the difference; if not, draw the whole column (cell, actually) as highlighted (or whatever you're doing).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for reply..
It will now work fine
If u can Dream .. U can do it..
|
|
|
|
|
Hi.
I have a side bar with a menu in an iframe, this sidebar is is very long (heigh). When I click on a button at the bottom of the menu, it reloads and gos up to the top. I want the srollbar to stay at the bottom when I click on this button.
Can I somehow use the (not) IsPostBack on the button? How can I do this?
Thanks!
-- Evil geniuses for a better tomorrow --
|
|
|
|
|
For starters, this belongs in the ASP.NET forum. If you don't want the button to post back, however, then don't make it a server control. A simple button element with an onclick handler will do. If you need more information, ask in the appropriate forum.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You need some javascript function because each postback is a submit in your page. I was with this problem but with linkbutton and I solved it without js just by setting href="" and not href="#" like I did... but it was a linkbutton! Good luck!
Wender Oliveira
.NET Programmer
|
|
|
|
|
just add a regular HTML button input type to the html, and don't rely on the designer to much...:
<br />
<input type="button" onclick="CallSomeJavaScriptFunctionHere()" /><br />
JS code (just googled for it...
<br />
function scrollToBottom() { <br />
document.body.scrollTop = document.body.offsetHeight; <br />
} <br />
<br />
function checkIfScrollToBottomIsNeeded() { <br />
scrollToBottomIsNeeded = ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) ); <br />
} <br />
<br />
function scrollToBottomIfNeeded() { <br />
if( scrollToBottomIsNeeded ) <br />
document.body.scrollTop = document.body.offsetHeight; <br />
} <br />
|
|
|
|
|
Hi,
I cannot find how to create a class at runtime...
if I know the type of the object, and need to create an instance..
foo myObject = new foo();
Type t = myObject.GetType();
// how do I create a new object of type t ??
|
|
|
|
|
|
The way i tend to do it is to get the constructor (usually the parameterless one) and call invoke on it using reflection..
<br />
Type t = ....<br />
<br />
ConstructorInfo constructor = t.GetConstructor(System.Type.EmptyTypes);<br />
<br />
object newObject = constructor.Invoke(null);<br />
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Hi ,
I want to give the color to the particular row of the datagrid at runtime....when....the template column is clicked....so i want to give the backcolor to the entire row at that time that means runtime....
In datagird I have a one column which is a template column...
i have tried like this but this is giving color to the row permanently.....& want to change its color as & when that row's template column clicked....please help me
for(int i=0; i < DGPODetailShow.Columns.Count;i++)
{
DGPODetailShow.Items[0].Cells.[i].BackColor=System.Drawing.ColorTranslator.FromHtml("#EBE5DE");
}
Can anybody help me....
Thanks
|
|
|
|
|
This question belongs in the ASP.NET forum. I'll give you a hint, though: read about ViewState .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all,
im new to this forum.
i have one issue, i want to do the programming in MSN6 messenger in C#.
do anybody has the idea from where i can get the library, functions for researching for the MSN6 messenger.
its urgent, please help me out.
thanx a lot in advance
Naveen
|
|
|
|