|
Granted, I'm new to C#. But I don't want the helper classes defined in the solution file to be put in separate namespaces, I want them to be in their own namespace that is accessable from the different applications, to avoid confusion.
I'm going to try the DLL solution you mentioned and see if I can get that to work.
Just to reiterate on my goal:
The applications in the project are contained within separate namespaces because MOST of the data in each is not used in the other. However, some of the basic data is derived from the same classes. Those classes I've put in a separate file in their own namespace. Just to show the structure:
The first two applications are like so:
Application 1:
namespace client
{
... // requires processing of class helper1 and helper 2
}
Application 2:
namespace server
{
... // requires processing of class helper1 and helper 2
}
SolutionFile.cs
namespace helper
{
enum type1 { ... }
enum type2 { ... }
class helper1 { ... } // USES ENUM TYPES
class helper2 { ... } // USES ENUM TYPES
}
I hope that clears up my problem a bit.
|
|
|
|
|
I want make my C# application to get all procedures' defination from IQ database using SQL "select * from sys.sysprocedure where proc_id>200",but when executing this sql,the exception "Capacity must be larger than 0" occused.
m_command = m_connection.CreateCommand();
m_command.CommandType = System.Data.CommandType.Text;
m_command.CommandText = m_strSql;
m_reader = m_command.ExecuteReader();
public Object this[String key]
{
get { return m_reader[key]; }
}
public String GetString(String key)
{
Object value = this[key];
if (Convert.DBNull.Equals(value))
{
return null;
}
else
{
return Convert.ToString(value);
}
}
How to get the long text which length more than 8K?plz help me!
Please pardon my weak English!
|
|
|
|
|
Hello
How I can show TV with Managed DirectX 9 ?
Can you showme a sample ? please
Thanks
|
|
|
|
|
Hy guys.
I'm Alessio, I don't speak english very well, so excuse me in advance.
I'm writing because I'm getting an error when I use the Graphics.DrawImage method with ImageAttributes parameter.
I've created a Form class to customize the TitleBar.
This "base" form is borderless and in the Constructor I store a small "gif" (30-40 Kb) in a bitmap object with the TitleBar I want to put in the form.
In the paint event I call a procedure passing the PaintEventArgs Graphic object and then I call the DrawImage using the bitmap object.
When the form has got the focus, I call "simple" DrawImage method, but when this form loss the focus, I use the ImageAttributes.SetGamma to brighten up the TitleBar (I pass "0.55f" to SetGamma) and then I call DrawImage passing the ImageAttributes object.
When I run my project, it's ok, but if I create a form that inherits from the "base form", and run the project, I've got an "out of memory" error when this form loss the focus.
Can you help me to understand ?
Thanx anyway
Alessio
|
|
|
|
|
Just a correction.
In that project I can load image from an extern file or from an embedded image I had added in project resource file.
In both cases I tried gif, png & jpg.
When forms are using external images, it's all right but when they use embedded image the "out of memory" error comes up.
I load this image in a Stream object through "Assembly.GetManifestResourceStream" method and then I create my bitmap object by "new Bitmap(MyStreamObj);".
If I use an Image object instead of the Bitmap object, all works fine, but I need Bitmap object because in the case of jpg images I need to call MakeTransparent method.
So, please, help me.
|
|
|
|
|
hi
i have a button in my page and add this attribute to button
<<button.attribute.add("onclick","<u>javascript:return confirm('Message');")>>
and also i have a textbox in my page that a requirefiledvalidator check that control not be empty.
if i click button, confirm window occur for me and if i press <<ok>> the code of this event execute while textbox is empty and validator not check the textbox. when event onclick of button finished validator check the textbox.
please help me.
thanks a lot.
|
|
|
|
|
hi there,
did u set isvalid = true in ur aspx page?
anyway, this is for C#, not ASP.NET forum ;(
<< >>
|
|
|
|
|
Hi all,
I want to place multiple bitmaps into one picturebox at the
same time placing them into different areas of the picture box.
Is it possible?
or any other way to do it.
Thanx
Rashid
|
|
|
|
|
Use the Graphics.DrawImage() either by creating a CreateGraphics() or Paint Event Handler e.Graphics
|
|
|
|
|
I have a class library written in C#. I have use it using "Add Reference" in a VB.NET windows application. Is there any way to lock the class library(dll) in such a way that no further "Add Reference" is possible ? Basically I want to prevent the reusability of the dll file for any other application except the VB.NET application, I told above. Is there any way to do such things?
Thank you in advance.
Anindya Chatterjee
|
|
|
|
|
hi there,
Why do u want to do that???
.NET is designed as OOP to save time/cost to develop software by reusablity mechanism!!!!. Just my thought
<< >>
|
|
|
|
|
If your code is ran trhough an obfuscator you could add require hte constructors of all the classes in the dll to fail if not provided a correct magic number. This would require modification of the calling app however.
|
|
|
|
|
I want to instance StrongNameMembershipCondition class.
[C#]
public StrongNameMembershipCondition(
StrongNamePublicKeyBlob blob,
string name,
Version version
);
the type of parameter blob is StrongNamePublicKeyBlob. I do not know how to get the parameter.
Can you help me? give some code.Thanks!
|
|
|
|
|
|
Hi,
I have the following regular expression:
// Validate news ID
Regex objPattern = new Regex(@"\d$");
string strID = Request.QueryString["id"].Trim();
bool boolSucess = objPattern.Match(strID).Success;
Basically this must test if id is just numeric. If I were to type in 44, then it is fine, if I type in 44E, then it is wrong. But when I type in 44.0 then the success is true. Why is this? I only want digits from 0-9 displayed, nothing else, no commas or decimal points.
Please could someone help. Let me know if my regular expression is incorrect.
Regards,
ma se
|
|
|
|
|
@"^\d+$"
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
Can anyone tell me how to create and delete a scheduled task in Windows. This can be accomplished using the AT command in DOS but I am unable to delete the scheduled task.
|
|
|
|
|
how can i create a DWORD value in the registry. Is the Microsoft.Win32.Registry class sufficient enough to do this. I checked the documentation but I couldn't find anything on DWORD values
|
|
|
|
|
SetValue("KEY", 5);
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
Hi,
I am a beginner in XML,I have to update a particular element based on some action(say a button click) .
I need to select that element and Update all the attributes ,values everything to new values which will be accepted through a user interface
I know it may be simple.To be more precise I want the similar operation that we normally perform in a database .That is update the record if its already present.
Thanks
|
|
|
|
|
Hi
This is easy .. if you know how to but c# (and .NET) is new to me .. so how do I do this.
I have a Form with 1 button (start) and 1 multi line text_box.
The start button calls a method wich copies files from one location to an other.
While coping, I want to show the progress by adding each file name to the text_box once its been copied.
I think I should run the import process in a separate thread, but cant get it to work (the text_box is opdated when all files are copied)
Can any of you c# experts give me a hint / example?
Cheers!
/Anders
|
|
|
|
|
Hi!
If you are adding text to the TextBox from a different thread, you'll have to use Invoke or BeginInvoke to call a delegate to insert the text.
You can also keep the copying in your main thread and just call Application.DoEvents() after appending the text.
That way the UI thread will process messages and your TextBox will be updated eventually.
Regards,
mav
|
|
|
|
|
Hi,
I have a windows form on which i have placed some controls. Basically the i get exception on line on which first text box is instantiated. This problem is only with Text Boxes. All other controls are instantiated well. Any solution please...
|
|
|
|
|
May it be a syntax error, in the code right above the instantiation.
"I am a lair" Is this statement true or false ?
|
|
|
|
|
Hi!
Knowing which exception is thrown would help tremendously.
Right now you just said "something is wrong". How are we to help you if you don't tell us what exactly is happening?
mav
|
|
|
|