|
|
Thanks you. I got it.
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|
|
Hello i am developing an window application in which there is a combo box and i am getting data in it from text file and i can also add data in this text file at run time that i have done so far.
Now what i want that whatever item i select from combobox and press delete button will be deleted from text file.
Please Help....................
|
|
|
|
|
This is a pretty trivial problem.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have started a banking project and i have no idea about the accounting transaction. I don't know the format of the trial balance, journal voucher , general ledger How can i do this?
|
|
|
|
|
Read any basic Accounting book
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Hi.
To learn Account follow this link
http://highered.mcgraw-hill.com/sites/0072423390/student_view0/
Helps you to learn accounting basic fundass....
Thanks
"Good Thing Goes With Good People..."
|
|
|
|
|
I have developed a windows applicaion in C#.I want to install this app in 10 system on the network.But i want to use same database( MS access) for application.I have a connection string in app config
<add key="DBPath" value="C:\Program Files\School\DB\School.MDB">
This is my original database path
how can access this database from other system on the network
please write the connection string in appconfig for other system?
|
|
|
|
|
You have to write like this
\\Server\C\ABC\MyDatabase.mdb
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Hi,
You can use [ Server.Mappath("\\x\\xx.mdb") ]
Try this.
Thanks
"Good Thing Goes With Good People..."
|
|
|
|
|
Hi
I have created custom controls like listbox, spinbox, textbox and treeview controls
And we are handling mouse wheel msg strategy through strategy design pattern .
Problem is when form has scrollbars and when we scroll on tree view control
Then form also gets scrolled which is not required i.e, if I scroll treeview only treeview must scroll not the parent.
So how to stop this, could your suggest me a solution for this.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Hi,
take panel and put treeview in that.
Give height to treeview and scrollbar to panel.
Solve your problem..
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
I want to replace Dash with a period only once in a string like
ABC-XYZ =ABC.XYZ
ABCXYZ =ABCXYZ (No Replace)
ABC-X-Y-Z =ABC.X-Y-Z
A-BC-XYZ =A.BC-XYZ
ABCXYZ- =ABCXYZ.
I found where the first dash is match using of IndexOF property of string.
And RegEx.Replace replace all the found characters I want to replace only first occurrence.
But how I can replace only once...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
write your own function, use loop, if character found then replace and then break or return.
|
|
|
|
|
string str = "ABC-X-Y-Z";
int index = str.IndexOf("-");
str = String.Format("{0}{1}{2}", str.Substring(0, index), ".", str.Substring(index + 1, str.Length - index - 1));
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Thanks for your reply.
But it will give error in case of
string str = "";
Because this input is depend upon the end user So I can-not say the input data in Correct format.
Or if dash is not found then it will also give the error.
I make new code please let me know this is Ok or not...?
**************************************************************
public static string getNewItemName(string actualItemName, string saparaterCharacter)
{
string valueToReturn = "";
try
{
int ipos = actualItemName.ToString().IndexOf(saparaterCharacter.ToString());
if (ipos > -1) //That means saparator is not found...
{
if (saparaterCharacter.ToString().Length == 0)
valueToReturn = actualItemName.ToString();
else
{
string strFirstPart = actualItemName.ToString().Substring(0, ipos).ToString();
string strSecondPart = "";
if (actualItemName.ToString().Length == 0)
strSecondPart = actualItemName.ToString().Substring(ipos).ToString();
else
strSecondPart = actualItemName.ToString().Substring(ipos + 1).ToString();
valueToReturn = strFirstPart + ":" + strSecondPart;
}
}
else
valueToReturn = actualItemName.ToString();
}
catch (Exception)
{
//In Case of any error we are returning the same name
valueToReturn = actualItemName.ToString();
}
return valueToReturn;
}
**************************************************************
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Hi,
u can try this.
string str= "xyz-x-y-z";<br />
int i = str.IndexOf("-");<br />
str = str.Insert(i+1, ".").Remove(i, 1);<br />
<br />
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Thanks for your reply.
But it will give error in case of
string str = "";
Because this input is depend upon the end user So I can-not say the input data in Correct format.
Or if dash is not found then it will also give the error.
I make new code please let me know this is Ok or not...?
**************************************************************
public static string getNewItemName(string actualItemName, string saparaterCharacter)
{
string valueToReturn = "";
try
{
int ipos = actualItemName.ToString().IndexOf(saparaterCharacter.ToString());
if (ipos > -1) //That means saparator is not found...
{
if (saparaterCharacter.ToString().Length == 0)
valueToReturn = actualItemName.ToString();
else
{
string strFirstPart = actualItemName.ToString().Substring(0, ipos).ToString();
string strSecondPart = "";
if (actualItemName.ToString().Length == 0)
strSecondPart = actualItemName.ToString().Substring(ipos).ToString();
else
strSecondPart = actualItemName.ToString().Substring(ipos + 1).ToString();
valueToReturn = strFirstPart + ":" + strSecondPart;
}
}
else
valueToReturn = actualItemName.ToString();
}
catch (Exception)
{
//In Case of any error we are returning the same name
valueToReturn = actualItemName.ToString();
}
return valueToReturn;
}
**************************************************************
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Pankaj - Joshi wrote: public static string getNewItemName(string actualItemName, string saparaterCharacter)
{
string valueToReturn = "";
try
{
int ipos = actualItemName.ToString().IndexOf(saparaterCharacter.ToString());
if (ipos > -1) //That means saparator is not found...
{
if (saparaterCharacter.ToString().Length == 0)
valueToReturn = actualItemName.ToString();
else
{
string strFirstPart = actualItemName.ToString().Substring(0, ipos).ToString();
string strSecondPart = "";
if (actualItemName.ToString().Length == 0)
strSecondPart = actualItemName.ToString().Substring(ipos).ToString();
else
strSecondPart = actualItemName.ToString().Substring(ipos + 1).ToString();
valueToReturn = strFirstPart + ":" + strSecondPart;
}
}
else
valueToReturn = actualItemName.ToString();
}
catch (Exception)
{
//In Case of any error we are returning the same name
valueToReturn = actualItemName.ToString();
}
return valueToReturn;
}
Hi,
here before checking anything you have to check that
if(str.Length > 0)
{
if(str.Contains("-"))
{
// here write everything.. will not give any error.
}
}
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hi.
I hope this work for you.
Write this in your some click events.
string xNew="";
int j = 1;
for (int i = 0; i < TextBox1.Text.Length; i++)
{
string x = TextBox1.Text.Substring(i, 1);
if (x == "-")
{
if (j == 1)
{
xNew = xNew + ".";
j++;
}
else
{
xNew = xNew + x;
}
}
else {
xNew = xNew + x;
}
}
Label1.Text = xNew;
Small Logic.
Thank you.
"Good Thing Goes With Good People..."
|
|
|
|
|
Hi.
I hope this will help you out..
Write somewhere in button event and test it....
string xNew="";
int j = 1;
for (int i = 0; i < TextBox1.Text.Length; i++)
{
string x = TextBox1.Text.Substring(i, 1);
if (x == "-")
{
if (j == 1)
{
xNew = xNew + ".";
j++;
}
else
{
xNew = xNew + x;
}
}
else {
xNew = xNew + x;
}
}
Label1.Text = xNew;
Thanks for watching it....
"Good Thing Goes With Good People..."
|
|
|
|
|
Hi,
Will Help you lot..... sure
string xNew="";
int j = 1;
for (int i = 0; i < TextBox1.Text.Length; i++)
{
string x = TextBox1.Text.Substring(i, 1);
if (x == "-")
{
if (j == 1)
{
xNew = xNew + ".";
j++;
}
else
{
xNew = xNew + x;
}
}
else {
xNew = xNew + x;
}
}
Label1.Text = xNew;
"Good Thing Goes With Good People..."
|
|
|
|
|
Hi.
//Hope this will help you to a Lot for sure.....
string xNew="";
int j = 1;
for (int i = 0; i < TextBox1.Text.Length; i++)
{
string x = TextBox1.Text.Substring(i, 1);
if (x == "-")
{
if (j == 1)
{
xNew = xNew + ".";
j++;
}
else
{
xNew = xNew + x;
}
}
else {
xNew = xNew + x;
}
}
Label1.Text = xNew;
}
"Good Thing Goes With Good People..."
|
|
|
|
|
string str = "ABC-X-Y-Z";
int index = str.IndexOf("-");
if (index>=0) str = str.Substring(0,index)+ "." + str.Substring(index+1);
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Yet another way:
if ( args.Length > 2 )
{
int index = args [ 0 ].IndexOf ( args [ 1 ] ) ;
if ( index >= 0 )
{
args [ 0 ] = (new System.Text.StringBuilder ( args [ 0 ] )).Replace ( args [ 1 ] , args [ 2 ] , index , args [ 1 ].Length ).ToString() ;
}
System.Console.WriteLine ( args [ 0 ] ) ;
}
|
|
|
|