|
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
|
|
|
|
|
Hi
I have a panel on FormA which contain different controls like labels, buttons etc. I am opening another FormB by clicking on buttonA(which is on panel with other controls). FormB display on panel, when i close FormB then controls(labels which contain text) on panel flicker.
can any one have solution for this problem.
Thanks
navees
|
|
|
|
|
You have two forms over here in your application. The second form display on click event of some controls, which is available in first form. Am i right so far ?.
If so, Probabily you will be doing any custom panel paint or default.
If you are doing custom painting then try to impliment Double Buffering techinicsin your paint event handler.
If not, insted of repainitng (form itself will do repainting when you chnage the status of container controls), only try to Invalidate contained controls which are really nessasary to paint.
<br />
Note : (1) Double Buffering.<br />
(2) Control Invalidating.
Please do little home work on the above mentioned ideas.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Hello gurus,
I have created a class that contains a set of different members:
- a 2D array: int[,] data;
- a string: string name;
- a Size: Size size;
- an ImageList: ImageList imageList
In my interface I have a combo box that has these classes as Tags and the combo displays the "name" member.
I wish to know how to serialize to a file and deserialize from a file the entire contents of the items of the combo box. Each items contains a class that I have described above.
Can someone show me how to do that?
Thanks.
Best regards.
There is no spoon.
|
|
|
|
|
The ImageList is not a serializable class, so you can't serialize it and will need to think how to reconstruct it after the de-serialization. If you mark your class with the [Serializable()] attribute and mark the imageList field with the [NonSerialized()] attribute, everything else should be done automatically by the framework.
Also, if you want to serialize a set of instances of this class, you can just put them in an array and serialize the array.
I see dead pixels
Yes, even I am blogging now!
|
|
|
|