|
HI Friends,
Look at this.
I have a array like this.
A B C
P Q R
1 2 3
Now I want something like the following.
AP1, AP1, AP3, AQ1, AQ2, AQ3, AR1, AR2, AR3,
BP1, BP2, BP3, BQ1, BQ2, BQ3, BR1, BR2, BR3,
CP1, CP2, CP3, CQ1, CQ2, CQ3, CR1, CR2, CR3,
The total number of combination will be 3 * 3 * 3;
THis is the problem.
Do u have any recursive logic of this.
Mind well,this array can be of any size.
Thank u all in advance.
|
|
|
|
|
How can I get an event of one process that is terminating in other process.Any idea ?
|
|
|
|
|
Get a Process object for the wanted process e.g. by calling Process.GetProcessesByName . Then set its EnableRaisingEvents property to true and register to its Exited event.
www.troschuetz.de
|
|
|
|
|
Hi,
I have been trying to use Asynchronous Callback to access
XML Web Services from my client application (Windows Form).
The client will call the method which will return a DataSet
and display the results on the DataGrid.
The problem is, the DataGrid doesn't seem to be updated
everytime the result is returned. Anyone knows why?
I have also checked using Debugger and the web method did
return the correct result.
Thanks.
|
|
|
|
|
|
|
Hi!
I am having a typical problem ,I am using management classes to get the path for shared folders and files of the system.The code is working fine for console and winforms,but it is not working for web applications.I have tried giving admin rights to aspnet account,but the problem remains there.Please help
ManagementObjectSearcher searcher1=null;
searcher1=new ManagementObjectSearcher("SELECT * FROM Win32_Share");
try
{
foreach(ManagementObject share in searcher1.Get())
{
s=share["Path"].ToString();//for asp.net pages giving null obj ref exception
}
|
|
|
|
|
I dont know how to play dat files in a C# form .If anybody has any idea please let me know .Thank you.
|
|
|
|
|
|
Hi,
I am beginning visual c# programming with xaml.
I was told, creating xaml file can be done using xamlpad. I am not clear with how to integrate this file with visual c# project and create an corresponding .xaml.cs file and add it under .xaml file.
Can somebody guide me how to create a .xaml project with visual c#, like the sample projects available in winfx sdk samples.
Thanks,
|
|
|
|
|
Are you using Visual C# 2005 Express or Visual Studio? Or are you compiling everything by hand?
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
When a value of CELL such as Grid was changed, a setting color wants to change temporarily, but is who or good advice not?
I'm Studying
|
|
|
|
|
Hi,
I have an application which will connect to server A. However if server A fails...it should try to connect to server B. I have no idea how to go about implementing this. Any suggestions?
|
|
|
|
|
What type of connection is this? Database? File share? Custom protocol?
Start by putting all of your communication-related code into a separate class (or at least identifying which classes you use fits this description): should specific exceptions get thrown, you simply reinstantiate or reconfigure the class with different parameters (telling it to use server B). In the case of a database connection, as an example, you would change the connection string.
This outlines the structure of a solution, but without more information I can't really help you.
|
|
|
|
|
Hi,
Tks for the reply. The connection is a database one. I had guess changing the connection string. However does connection lost or no connection exceptions come with common error strings.
I guessing using this.
try
{
str1 = db1;
conn.ConnectionString = str1'
conn.open();
}
catch(Exception msg)
{
if(msg.Message.ToString()=="No Connection")
{
try
{str1 = db2;
conn.ConnectionString = str1;
conn.Open();
}
catch(Exception msg1)
{
MessageBox.Show("Total Connection Lost");
}
}
}
Something like these?
|
|
|
|
|
Try: catch (SqlException ex). You can get far more from exceptions than that:
Put a breakpoint on your MessageBox.Show, then quick-view the exception when the code gets there. You'll get a lot of info from there, including the actual sub-type of the exception that got thrown.
|
|
|
|
|
tks for the reply...
ok i tried that...I'm guessing i could use the number property to specify the error that i need to process..Also, there's one thing that puzzle me. There is a ConnectionState.Broken...when will this state occur? i tried have a connection open..then pluck off the cable..so i thought this is suppose to be connection broken. However the state of the connection is still open. Is there anything that i can refer to as to detect a break in connection from an open connect?
|
|
|
|
|
hi..
i hav developed an application to send fax automatically..i want to put this application in to the system tray how can i do that..
thanks...
|
|
|
|
|
for that u can use notifyIcon
|
|
|
|
|
|
Hi,
Suppose I have:
class Point
{
private int x,y;
public void Point()
{
........
}
public int X
{
set{x=value;}
get{return x;}
}
public int Y
{
set{y=value;}
get{return y;}
}
public void Draw()
{
....
Console.WriteLine("*");
}
}
class MainApp
{
static void Main()
{
Point p=new Point();
p.X=10;
p.Y=10;
p.Draw();
}
}
I want that When i call p.Draw() ,will appear '*' at position (p.X,p.Y).
Please ,help me.
Thanks a lot!
|
|
|
|
|
hi there,
do u mean that it'll draw * character in console or window form mode?
if window form mode, u cannot use Console.writeln...
if console mode, u hv to jump the cursor to that position and simpy write start character to the console.
<< >>
|
|
|
|
|
Hi Friends,
How to use OLE object to retrieve data into Multilayerd Spread Sheet. I am able to retrieve data into multi-tab spread sheet. I could not able to pull the data into multi-layered spread sheet.How to create Multi-Layered spread sheet using C#?
Sarat Gollapudi
|
|
|
|
|
Dear friends,
I have to write a project that's able to read & write data to an excel file. Just simply like a data base program.
do you have any hints or example?
|
|
|
|
|
I had a big headache trying to do this myself. There may be a way to read and write to a file, but I found I a diffent way to write to Excel, and a different was of reading from, with some help from one of our friends on the CodeProject.
Here is a simple example of writing to Excel. It creates a new Excel book and writes a string in the 1st cell.
/**************************************************/
using System;
using Excel;
using System.IO;
using System.Text;
using System.Data.OleDb;
namespace Writing_to_Excel_example
{
class Class1
{
static void Main(string[] args)
{
bool xlsError = false;
int rowCount = 0;
int counter = 0;
int counter2 = 0;
Console.WriteLine("Working...");
Excel.Application ExcelObj = new Excel.Application();
Excel.Workbook workbook = ExcelObj.Workbooks.Add(Type.Missing);
if (ExcelObj == null)
{
Console.WriteLine("\nERROR: EXCEL couldn't be started!");
xlsError = true;
}
// activate the active worksheet in the workbook
Worksheet ws = (Worksheet)ExcelObj.ActiveSheet;
ws.Activate();
try
{
//To enter text to a specific row and column:
((Range)ws.Cells[1, 1]).Value2 = ("This is Row 1, Column 1");
//To set an entire row as Bold.
((Range)ws.Cells[rowCount, 1]).EntireRow.Font.Bold = true;
}//end try
catch(Exception e)
{
Console.Write(e);
}
//Make Excel visible.
ExcelObj.Visible = true;
}
}
}
/***************************************************************/
DONT FORGET TO ADD REFERENCE TO EXCEL 11.0 OBJECT LIBRARY!!
As for reading from excel, I tried to apply the same sort of logic as above but it didn't work. So have a look at this link:
http://www.codeproject.com/csharp/FasterExcelAccessTOC.asp[^]
Great tips there, a great help to me, Thanks to Dusty Candland, great help mate!!
t-seanm
|
|
|
|