|
Does IsNull simply check if the value is null? If so:
if(objRecordSet.Fields("SNO").Value == null)
{
strYesNo = "Yes";
}
else
{
strYesNo = "No";
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
You'd better go with either my or Judah's post since Greeegs is not valid C#
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi,
I want to develope an web application using asp.net 2.0.For validation,whether javascript validation is better or using validation controls is better?
Thanks in advance.
|
|
|
|
|
A lot of this is going to depend on two things; how complicated is your validation? and how good is your java.
The validation controls just generate java script to run on the client, so you are not buying anything by doing it in java unless you have some validation that the controls won't do.
The big advantages of using the validation controls is that you don't have as much code to write or support AND the validation automatically happens on the client AND the server side. If you write your own java script, and want the added security of having the validation run on the server, you'll have to code it there as well.
HTH
WhiteWizard
aka Gandalf
|
|
|
|
|
I`m getting trouble with a rdlc report in VS 2005.
I want keep a group together in such way the pages doesn`t break when the group doesn`t fit exactly in the page. I have searched a lot in the report/group properties but didn`t find anything helpful.
Does anybody know how to solve this? In design time? Programmaticly?
I`m using C# and developing a desktop app.
Thanks in advance ...
|
|
|
|
|
use sub-report instead. use group detail in first report, sending parameter to sub-report.
|
|
|
|
|
How do I get the image width and height of a bitmap image?
tony-yeyo
|
|
|
|
|
Look at here: MSDN
Use Width and Height properties of the Bitmap class.
|
|
|
|
|
Hi,
I have got reportviewer working fine with a simple 5 line report BUT when I click on Print, the Windows Print Dialog box shows and then a variety of situations open up:-
The Page Range details don't show in the radio buttons section viz all pages selected pages.
Click Print and nothing happens.
Change printers back and forth then you get Printing Page 1 and then Page 2 of 2 - there's only one page and nothing gets printed anyhow.
Click Cancel and wait a few seconds and it cancels.
Try to Print the document again (not necessarily after any combination of the above) - works perfectly.
Any ideas?
Glen Harvy
|
|
|
|
|
Hi!
I have created a simple server application and now I'm trying to create
sensible UI for it. The problem is that I don't know how to send log-messages
from other classes(Server,ConnectionProcessor etc) to be printed in a
multiline textbox in the main form(ServerForm, which starts the server-thread and so on).
I have tried some things with delegates but without success. Here's a little
example of what I have tried:
public class Server{
public delegate void printMessage(string message);
public printMessage print;
public void test(){
print = new printMessage(new ServerForm().printMessage);
print("Message printed via delegate");
}
}
public class ServerForm{
//Some code...
public void printMessage(string message){
serverLogTextBox.Text = message;
}
}
Any ideas, suggestions and possible solutions are hugely appreciated.
Thanks in advance.
-K-
|
|
|
|
|
TikkuTakku wrote: print = new printMessage(new ServerForm().printMessage);
This means there's a ServerForm somewhere that will get this message, but it won't be the one you're using. You need to do this in reverse. The main form should set the delegate to a method in itself. Either way, you need to set it to the same instance of the class that you're actually running.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I still don't quite get it. Sorry
I mean, how do I get the other classes to use printMessage-method of that particula instance of ServerForm
-- modified at 8:23 Tuesday 22nd August, 2006
|
|
|
|
|
Either you need to pass this Object of UI to ur server. or create an even in the server class and register it in UI. so whenever server get some message trigger the event, in UI capture the event and print the message using eventarguments.
|
|
|
|
|
When you call new, you create a NEW class instance, and THAT class instance has a delegate attached to it. But it's NOT the instance that is being used by your program. You need to hook the delegate to the instance that is in use. You probably need to read up on what new does and what a class instance is, or at least how they relate to delegates ( a delegate gets hooked to one instance, not to all instances automatically )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
How to read a single element in DataGrid ?
Thanks in advance
|
|
|
|
|
try out
datagrid1[rowindex,columnindex].ToString();
rahul
|
|
|
|
|
How do I view a 2 pictures in 2 different windows at the same time?
tony-yeyo
|
|
|
|
|
place a picturebox on each window and use the "Image" property to select your picture.
All the best
Martin
|
|
|
|
|
Make them modeless ( show instead of showdialog ) so they are both responsive. More detailed info than what you've been given in the two responses you have would require more info about your situation.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have done a project in .net. I want that when a user tries to run the .exe, if it is already running then the same instance should be focused and no new instance should be creaed.
what to do please let me know
|
|
|
|
|
check out this code
string aModuleName = system.Diagnostics.Process.GetCurrentProcess.MainModule.ModuleName;
string aProcName = System.IO.Path.GetFileNameWithoutExtension(aModuleName);
if (system.Diagnostics.Process.GetProcessesByName(aProcName).Length>1)
{
Application.Exit();
}
Navin
|
|
|
|
|
You can use a Mutex. Here is a piece of code that shows how to do it:
In program.cs:
<pre>
private static System.Threading.Mutex _mutex;
private const string _mutexName = "Company_Product_MUTEX";
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//Allow only one instance for this app to be active
try
{
//try to open existing mutex
_mutex = System.Threading.Mutex.OpenExisting(_mutexName);
if (_mutex != null)
return; //exit program;
}
catch
{ //There was no existing mutex so create mutex
try
{
_mutex = new System.Threading.Mutex(true, _mutexName);
}
catch { };
}
Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
/// do rest of the code, like Application.Run() etc.
}
static void Application_ApplicationExit(object sender, EventArgs e)
{
//Release Mutex
if (_mutex != null)
{
_mutex.ReleaseMutex();
}
}
</pre>
That should do the trick.
|
|
|
|
|
Create a Mutex in the very first instance and if it already exists, then just quit your application. Some pseudocode:
if(!Mutex.Exists("SomeName"))
{
Mutex.Create("SomeName");
}
else
{
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Single Instance[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
hi
i want to access the serial port to send or read data from that.
in this case i want to use Win API in my application.
my application is written in C#.net and .Net frame work version is 1.1
in this version the namespace SerialPort is not worked.
thatway i want use Win API's to communicate the serial ports.
and also list of Win API which are useful to communicates the serial ports in C#.Net
or any one can send some example programs the serial ports in c#.
plz help
G.Prem Kamal
|
|
|
|