|
jrahma wrote:
what if I want to get the yahaa() n a separate DLL file and call it from the DLL.
Are you asking how to call the yahaa method (while it resides in the .DLL) from the forms?
Easy. Create a seperate class and more you're yahaa code to it. Since yahaa deals with the form properties, you'll have create the method with the ability to take a Form object as a parameter.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a way to vertically scroll (at least specify the first visible node) a TreeView without scrollbars being shown (that is the Scrollable property being off). Initially I thought that the Scrollable property indicated whether the scrollbars are shown or not but it seems to mean more than that as it causes Node.EnsureVisible() to not work as well.
I need to use the TreeView side by side with another control and I would prefer for the other control to deal with scrolling and not have a TreeView scrollbar in the middle between them.
|
|
|
|
|
Not without drawing the entire treeview yourself, search for "custom treeview" for some articles.
You're right, no scroll bars equals no scrolling.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This is probably a newbie question, but I could use some help making sure I get it right. Over the past couple of months I've taught myself a boatload of C# as well as some VBA and some ADO. I've developed a database application on my own computer at work accessing a database that I set up in Access (as a project) and that I access through an instance of MSDE 2000 running on my machine.
Here is how I connect to the server from my own desktop (I've changed a few of the details of DataSource and workstation ID because I'm not sure if that's the kind of thing you post in the open or not):
@"Integrated Security=SSPI;Packet Size=4096;DataSource=""EC-BJACOBS"";Initial Catalog=BenefitSelectDBSQL;Provider=""SQLOLEDB"";Workstaton ID=""EC-BJACOBS"";Use Encryption for Date=False"
So that's been working fine for me as I develop this sucker over the last couple of months, but now I'm nearly done and I want to be able to run the program remotely (I'm sacrificing my desktop on the altar of experimentation and letting it be a server for a while). Before anyone laughs that my company is trusting someone with a degree in math and no coding experience (other than a minor in CS) to build and deploy a distributed database application, it's not mission critical (at all) and they don't have anyone else better.
So here's my question: what modifications do I need to make so that other people (already on the network) will be able to access the database from their own computers? Do I need to make any changes to the string above? Or is it good to go?
If it's a long answer, just point me in the right direction and I'll do the research.
Thanks for the help!
|
|
|
|
|
I just forgot to sign in (new laptop)
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Assuming you have a simple Client Server (mainly database in this case) architecture.
(1) Create a DSN on each of the target computers.
(2) Deploy the application on them and connect using that DSN.
If you dont want to use a DSN, just connect using the same connection string you mentioned. You can probably keep it in a configuration file.
Live Life King Size
Alomgir Miah
|
|
|
|
|
I am making a windows form. It's shape is a perfect circle. The problem is tha the shape displays some extra color beyond the countour of the shape, and it looks really bad. I am using a panel wich and the background image is my shape. The color of the panel is set to transparent and the transparent key of the form is set to "Control". I am using a png. Pls help. thx
|
|
|
|
|
OVERVIEW: When a user browses for a file it can choose and file extension. I want to limit this. So that if they choose say a jpg file it will say: " Sorry wrong ext. please submit an .xls file." I want to force the user to submit an excel file only. Any Clue will be help full.
I posted my code below.
Thank in advance
public class WebForm2 : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlInputFile inpFile;//Browse file
protected System.Web.UI.WebControls.Image imgPAIS;//PAIS image
protected System.Web.UI.HtmlControls.HtmlInputButton btnSubmit;//Submit button
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent(); //Calls the sub-procedure
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.btnSubmit.ServerClick += new System.EventHandler(this.btnSubmit_ServerClick); //when btnSubmit Clicked
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnSubmit_ServerClick(object sender, System.EventArgs e)// When btnSubmit Click follow sub-procedure
{
if( ( inpFile.PostedFile != null ) && ( inpFile.PostedFile.ContentLength > 0 ) )
{
string fn = System.IO.Path.GetFileName(inpFile.PostedFile.FileName);
//string procID = DateTime.Now.ToString("MMddHHmm");
string SaveLocation = Server.MapPath("Data") + "\\" + fn; //+ "NewUsers." + procID;//+ ".xls";
try
{
inpFile.PostedFile.SaveAs(SaveLocation);
Response.Write("Your file has been successfully submitted."); //Reads when file is done submitting
}
catch ( Exception ex )//If no file read
{
Response.Write("Error: " + ex.Message);
}
}
else
{
Response.Write("Please select a file to submit."); //Reads when no file selected
}
}
}
}
|
|
|
|
|
You can try to open it using OleDb provider for Excel to check if it's really a Excel file.
Checking only the extension won't solve the problem, because the user can always rename the file.
|
|
|
|
|
I am not sure what you are saying. SO I browse for the file through oleDB provider. How can I do that?
thanks
|
|
|
|
|
t21 wrote:
I am not sure what you are saying. SO I browse for the file through oleDB provider. How can I do that?
What I'm saying is that you can't control at the client which kind of file they'll send. Only after the file arrives at the server is that you can control whether or not you'll accept that file.
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
Hi,
can any body tell me how to filter or remove non-arabic unicode characters from a string
OR
How to know the characterset of a character (Latin, Arabic, Urdu, Hindi etc.)
thanking you in advance
|
|
|
|
|
how can i size the button control for it to look like oval shape
|
|
|
|
|
You can't. You have to use an image button.
|
|
|
|
|
and you have to make the image first!
- =[M A S T E R S Dev]= -
www.3d-design.0catch.com
|
|
|
|
|
Microsoft states:
"Note: Sinks that need to create or modify the message itself must be placed in the sink chain prior to the formatter. This is easily achieved by implementing IClientFormatterSink, thereby fooling the system into believing that it has a reference to the formatter sink. The real formatter sink can then be placed later in the sink chain."
But what is the name of the real formatter sink to put next in the sink chain?
Thank you !
|
|
|
|
|
I think that the name of the formatter sink to put next in the sink chain is IClientFormatterSink with the corresponding IClientFormatterSinkProvider.
Another way to achieve this is to let the custom sink implement BaseChannelSinkWithProperties, IClientChannelSink, IMessageSink. Then you have a sink prior to the formatter sink.
|
|
|
|
|
Hi everyone.
I don't often use web services, so could be missing something here, but I'm really stumped.
I have created two web services, one of which seems to work exactly as it should. In that webservice, i have the following code:
public ArrayList GetItems(int repid)
{
SQLConnection sql=new SQLConnection();
sql.Open();
ArrayList items=new ArrayList();
OleDbDataReader dr=sql.Get_DataReader("Select lblname, Ftooltip, maxlength, itemindex, id from form where repid="+repid+" order by itemindex");
while (dr.Read())
{
items.Add(new string[] {dr.GetString(0), dr.GetString(1), dr.GetInt32(2).ToString(), dr.GetInt32(4).ToString()});
}
dr.Close();
sql.Close();
return items;
}
This does what it should, and returns an array of type object[], where each instance is of type string[]. Fine.
In another webservice, I have this code: (different project, but both are C#.net webservices)
public ArrayList GetMsgHeaders()
{
SQLConnection sql=new SQLConnection();
sql.Open();
ArrayList info=new ArrayList();
OdbcDataReader dr=sql.Get_DataReader("Select * from message");
while (dr.Read())
{
info.Add(new string[] {dr.GetInt32(0).ToString(), dr.GetString(1), dr.GetInt32(3).ToString()});
}
dr.Close();
sql.Close();
return info;
}
Now, i thought they were much the same thing, but when I use this one, the application crashes, telling me:
Additional information: Server was unable to process request. --> There was an error generating the XML document. --> The type System.String[] may not be used in this context.
What have I done wrong?!
-- modified at 8:50 Friday 26th August, 2005
|
|
|
|
|
Hi,
Is Shockwave Fash object in c# can help me to handle actions in flash?
This question i found answer about it and the answer is yes through FSCommand event handler where in flash i call this function to send some limited messages i that see in help of flash but they said there other messages can be sent to serve C# but i didnt find any more help.
If you can help me send me please.
Regards
Hisham Galal
|
|
|
|
|
Hi,
I found answer, If you wanna it send me.
Thanx for caring in rading my question
Regards
Hisham Galal
|
|
|
|
|
Please Send me the anwser code.
Muhamad Waqas Butt
waqasb4all@yahoo.com
|
|
|
|
|
Hi,
To use and determine actions ocurred in flash in c# simply, write Actions in flash normally, then use the following (Actionscript) function [ fscommand("exec","mesaage")] in the same place.
This function will send message to "FSCommand" Shockwave Flash Object event handler like that
private void axShockwaveFlash1_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e)
{
//MessageBox.Show(e.command); //this will desplay exec that is written in flash code
MessageBox.Show(e.args); //message will appear here
}
by this technique you can do anything you want for flash in c#
Regards,
Hisham Galal <me4webby@yahooo.com>
|
|
|
|
|
Hello,
I will try to translate next dll written with
MS Visual Studio C++ 6.0 to MS Visual Studio 2003 C#.NET
I need this (example) DLL to communicate with a industrial robot.
The steps for making this application in C++ 6.0
Step1:
Make new file and select "Win32 Dynamic Link Library"
Select "A simple DLL project"
Step2:
Make MyDll.cpp
<br />
#include "stdafx.h"<br />
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
return TRUE;<br />
}<br />
<br />
long _stdcall MyDllAdd(long a, long b)<br />
{<br />
return a + b;<br />
}
Step3:
Make DEF file: Select "File | New" and create "Text file" called MyDll.def
EXPORTS<br />
MyDllAdd
Step4:
Build the DLL and place it in "C:\Winnt\system32"
Now I will make the same DLL with C#.NET and distribute to the robot PC
with Windows NT SP4
Can somebody help me...
|
|
|
|
|
gr1967 wrote:
Can somebody help me...
I don't know if I understood correctly, but if you're trying to generate a native Win32 DLL with C#, no one will be able to help you. There's no way to export a C# function as a native method call.
C# DLLs can only be accessed by using .NET or COM.
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
Hello
I think it's better not convert/rewrite your C dll to C#, but to write interop library on C# for you dll. So, you will need to distribute your original dll and C# dll.
Andrew
|
|
|
|