|
For each event a class defines it has an EventHandler member that's managing the delegates to invoke when the event is fired.
This EventHandler is created the first time a client subscribes to an event.
Until that moment the EventHandler variable is still assigned null, so calling any of its methods will throw the NullReferenceException .
mav
|
|
|
|
|
I would like to write an application which can send sms messages from a pc to any mobile cellular phone using C#. I would appreciate if any one can help me archieve this. Thanking you in advance.
Justin
mj
|
|
|
|
|
Hi Jasto,
Yes 4 years ago – now problem! But today all the telephone company’s charge you for sending a SMS via there servers. Earlier you could send it like an e-mail writing your message in the subject field and sending the mail to fx. xxxxxx@TDC.mobil.dk but today all the company’s I know of has close the service for public use, and you have to contact your telephone company to buy this server.
Sorry – the world is not always free
/ Magnus
|
|
|
|
|
Hi
maybe it would be simple but never tried..how can I access an Ms Access file(.mdb) by giving an IP address,i dnt find any such option in OleDb
-adnan
|
|
|
|
|
Since Access is a file-based database, you'll need file system access rights to the remote machine. There is no Access server for you to attach to! So, in your connection string, then data source would be just like any other Windows UNC path:
\\ip.address\share.name\folder\subfolder\AccessDatabase.mdb
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I used following before i give try to your approach
String remoteConnStr="Provider=MS Remote;Remote Server=127.0.0.1;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\iconfig.mdb";
String mysql=String.Empty;
OleDbConnection con=new OleDbConnection(remoteConnStr);
con.Open();
MessageBox.Show(con.State.ToString());
mysql="SELECT * FROM preferences";
OleDbCommand cmd = new OleDbCommand(mysql,con);
OleDbDataReader reader=cmd.ExecuteReader();
MessageBox.Show(reader.FieldCount.ToString());
i am getting exception on last line OleDbDataReader reader=cmd.ExecuteReader();,Con.state is displaying Open,so i assume connection is being established,the following exception is being thrown
System.InvalidCastException: Specified cast is not valid.
at System.Data.OleDb.OleDbException..ctor(IErrorInfo errorInfo, Int32 errorCode, Exception inner)
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hResult, OleDbConnection connection, Object src)
any hint?
|
|
|
|
|
Well, I had no idea you we're using MS Remote, which is being deprecated by the way. I've never used it because I always use SQL Server or MSDE, never Access databases anymore...
From what I've seen in all the documentation, it only works over http, so, your Remote Server parameter should be:
...Remote Server=http:
and your machine should be running IIS.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'd like to add an UserAccess-Function to a SQL-Select-Statement.
It's a normal Statement like "Select * from Table Where Status = 'A'".
I'm loooking for a way like "... Where Status = 'A' And AccessFunction()"
or
bool lRes = AccessFunction();
sqlString = "... Where Status = 'A' And " + lRes.ToString();
I don't like to use UDF's, because the Application should work with several Databases like SQL-Server, Access, Foxpro, ... and I don't like same doing code at several places.
Has anyone a helpfull answer ?
Best thanks to you.
|
|
|
|
|
Try
sqlString = "... Where Status = 'A' And 1=" + ((int)lRes).ToString();
Ravindra Sadaphule
MCSD.NET
|
|
|
|
|
thanks & sorry,
seeing your answer I realized, that the second codesnippet in my question dosn't describe my real problem - my mistake.
I need a dynamic function call in my SQL-statement such like how in the first codesnippet described ("... Where Status = 'A' And AccessFunction()").
The real problem is, that the functions result depends in normal case on the fieldvalues of the selected records (but I don't like to use UDF's).
For instance, there are some access rules for various usergroups (usergroup "xy" may only see the customergroup "ABC", usergroup "yz" but the customergroup "CDE").
My solution now is to add an boolean field to the datasets table after the fill-command, calculate that for every selected record with my accessfunction and use it in my datagrids binded dataview as a rowfilter.
Do you know a better direct way for these problem ?
thanks for your help,
Rainer Ziebarth
|
|
|
|
|
I have a Windows Service running in the same server as SQL Server. This service uses lot of resources (basically memory). The problem is that at some point, SQL Server uses almost all the available memory in my server. The service runs a memory intensive process from time to time, and I constantly receive an "OutOfMemory" exception (sql server is not leaving much available memory for my service to do its tasks). My service needs about 20MB of free memory, and my question is: Is there any way to pre-alocate this amounth of memory to my service. I mean... not really "allocate" the memory, but "reserve" the memory.
Maurício Ritter
Mauricio Ritter - Brazil
MSN: mauricioritter(atsign)hotmail.com
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
There is a spelling error in your spelling error disclaimer. It is "errors" not "erros" (eros? )
SCNR
|
|
|
|
|
And now for something useful:
Basically, .NET takes Memory Management out of your hands (GC-wise), so you can simply hack away.
If I was you, I wouldnt want to lose that ability.
I am not sure about .NET, but in Suns JAVA-VM you can specify how much memory you need and the Runtime would then reserve it.
This is one way you could go (that is, IF .NET has similar functionality). The other way would be limiting the SQL-Server to a certain amount of memory (if possible).
The third (and slowest way) would be try/catching each memory-affection operation and then retrying (with a 20ms sleep, maybe) until you get your operation completed (I understand that the memory-consuming allocations of the SQL-Server are peaks only).
There may be more solutions, but the above are all I can think of.
Before I forget, there also are 2 non-programmatical solutions to your problem:
1st - let Windows handle the page file or set it to something bigger (e.g. 1 GB)
2nd - upgrade your server (more physical RAM)
Cheers
Sid
|
|
|
|
|
You can set SQL server to a maximum memory usage, otherwise it just uses memory until the server starts paging. Increasing the page file should fix the problem as well, but then you would be causing the server to page which is a bad thing for performance.
Better would be to move your process off the SQL server, or find a different algorithm.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Hi,
I am creating a design environment so that my users can design certain elements of the program themselves. To do this I require the use of the PropertyGrid control. The elements that I am letting to the user change are sub classes of the Control object. The problem I have is the attributes that the PropertyGrid displays. When I set the SelectedObject of the PropertyGrid to my own element it shows all the attributes for the Control class as well as the elements class.
With this design tool being used by users, I don't want them to see attributes like AllowDrop etc...
How can I suppress some of these attributes and events?
Regards
Chris Mitchell
|
|
|
|
|
Hi ,
i am using vbscript to open word document in my web page.(web page
is written in c# )
The code snippet in below. This code is doing what i want.
however when i try
to go back opener page with internet explorer "Back" button this
function is working again and word document is opening so i could
not open my page again.Is there any solution to unregister or block
this script...
string redirect = "c:/NewFolder/xxx.doc";
script = ""
+ " window.location=\"" + redirect + "\""
+ " ";
Page.RegisterStartupScript("__JS_OPENFILE",script);
thanks..
|
|
|
|
|
hi,
i want to create baloon tips which give hints about elements in a html page, like the ones which pop up on the taskbar to say that new updates are available etc. i'm accessing the html document through a iwebbrowserapp object. my created baloon tips should also not disable the focus of the html page. the user has to be able to click on the baloon tip (e.g. to let it disappear) or on an element within the html page.
can anyone give me some hints how to realize this?
thanks for help.
pikebu
|
|
|
|
|
Hi,
I have a DataGrid full of data which I would like to print. The columns and data are different depending on what query is run by the user. What way can be used to get this data into a printpreview screen to print or just print it straight to the printer?
Thanks for any help.
regards,
Stephen McAllister
|
|
|
|
|
Hi,
Guess the followinf link will help you.
http://www.c-sharpcorner.com/Graphics/DataGridPrinterMG.asp
Thnaks
SGS
|
|
|
|
|
Dear members,
This is not a specific tec doubts. This all about your experience and your way of dealing the issue.
Brief idea:
We have an application which uses Sybase database as Backend and Dotnet( C# Lan) as Front-End. This application uses IAnywhere.Data.AsaClient.dll (managed provider for Sybase db). This application is a small supporting module for our ERP which is developed using Power Builder.
Real requirement.
Now we are deciding to make this application as a pluggable for our ERP and also can plugged into other ERPS or applications, which have raw data needed to run our pluggable application.
Here the raw data ( data required to run this pluggable application ) may be in different database ( Db2,Sql Server,Oracle,Sybase etc). But now we don't have any interface or mechanism to pull the data from other Databases into my data base with required form (field name and data types).
What will be the better solution to make my product as pluggable for other application. ?
What is the real industry standard to tackle this sort of scenarios. ?
If you need to face this issue, what you will prefer to get out of this ?
How will i make a Data Pipe kind of mechanism to get required data in required form from other databases ?
Please do comment for this query. Your post will be most appreciable.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
My teacher give me a project ,it is "use .net to implement internet message board ,it includes the implement of the server ,the implement of the client...",mine is the implement of the client ,I just want to know where to start,my teacher said like the chat room is one of the example ,could somebody tell me where to start ,many many thanks
|
|
|
|
|
|
OK, lets have a look at your problem:
Implementation of information exchange over TCP/IP.
First, there are 2 types of participants in this system: The Server (which stores all data and provides clients with the necessary information) and the Client (which displays data to the user and allows users to send information to each other).
Thus, this is called "Client-Server-Architecture".
First, you need to specify what your client should be able to do. Are you implementing a chat-system (near realtime) or a message board (not realtime).
Second, you need to specify HOW data is transferred from the client to the server and vice-versa.
This really is up to you. for a simple chat system, this would be something like:
Client-to-Server: nickname, flags (color, bold or whatever) and message.
Server-to-Client: timestamp, nickname, flags, message
The Client would be running a UI with 2 threads: one sending thread and one listening thread, where the sending thread transmits everything from an input-field when ENTER is pressed and the receiving threads listens for messages from the server and updates a chat-window accordingly.
The Server would simply have an array of sockets to his clients and forward every arriving message to every client (or specific clients, if there is a "private chat" included), stamping each message as it arrives. You could call that "mixing", as the server arranges all messages by their arrival timestamp.
With a message board, you also will have to think about retrieving only certain messages (in order to preserve bandwidth) and how to authenticate yourself at the server.
Of course, this is just my opinion.
Cheers
Sid
|
|
|
|
|
hi all,
i need to view a html(say abc.html) in my form and compare it to another html . both these should be placed side-by-side. i need to add synchronized scrolling to these.
any inputs?
thanks
|
|
|
|
|
After hours of googling, i concluded... it is NOT possible to set a custom paper size through the pagesettings class. (i mean printdocument.defaultpagesettings.papersize = new papersize(...) )
Please correct me if i'm wrong!!
(PD: i've found lots, and i mean lots of posts in many web sites about this ... wow ... nobody can set a new papersize? I tested this in vb 6.0 and i CAN do so in three lines of code, but seems impossible to do in C#)
|
|
|
|