|
M Riaz Bashir wrote: "MR ABC","BLOCK 25","CITY","COUNTRY"
String StrText="MR ABC","BLOCK 25","CITY","COUNTRY";
string [] SplitText= strText.Split(',');
Now, SplitText is an string array which contain 4 element
SplitText[0]="MR ABC";
.
.
SplitText[3]="COUNTRY";
Now, you can store it easily in ArrayList or DataTable .
|
|
|
|
|
Abhijit Jana wrote: String StrText="MR ABC","BLOCK 25","CITY","COUNTRY";
string [] SplitText= strText.Split(',');
Now, SplitText is an string array which contain 4 element
Not quite, you cannot allocate a string as
="ABC", "DEF" as there is not such C# syntax. Replace with:
string strText="\"MR ABC\",\"BLOCK 25\",\"CITY\",\"COUNTRY\"";
string [] SplitText= strText.Split(',');
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff wrote: string strText="\"MR ABC\",\"BLOCK 25\",\"CITY\",\"COUNTRY\"";
Yeah. you are right. Actually I didn't concentrate on that part. It should like that you said. That was my silly mistake.
Thanks for correcting me
|
|
|
|
|
Bashir..I guess your question is your answer..You mentioned -
M Riaz Bashir wrote: text data and i want to split
So just check out the Split method of String.
|
|
|
|
|
This article [^]may be of use. You need to be careful of additional commas in the data and when to remove the double quotes.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I Just make a formula for....
sum({Invoice.Cost}
but it gives an error....
A Number filed or currency Amount field is required here.
|
|
|
|
|
Hi friends,
what is the best way to implement given requirement.
I need to open multiple forms in multiple tabpages control and save it on application exit and reload it on Application starts.
Thanking you,
modified on Saturday, August 8, 2009 2:42 AM
|
|
|
|
|
If your forms have a serializable model (a type that holds each form's state), serialize and persist it when application exits. This can be deserialized for restoring the state when application starts next time.
Other way is to manually persist all the information that needs to be restored. You can use any kind of persisting mechanisms.
|
|
|
|
|
In my application, I do the same thing. I save only the location and size of forms.
|
|
|
|
|
As you want to save the layout,create a base form and inherit all the forms.
Now for saving layout you can have a single utility class which would take the base form as parameter to serialize.So while eixiting the application pass your forms instance to serialize. Do the unserialization while application start.
I can suggest you a thrid party (if budget permits ) DevExprss [^]controls which might be helpful in this.
|
|
|
|
|
Dear Arindam
Thanks,
I do the same thing but i am unable to serialize class as it contains
property of type TabControl.
|
|
|
|
|
|
Hi Shakti,
Today got sometime and posted one article [^]which might help you.
Keep me posted if this helps.
|
|
|
|
|
Dear Arindam,
Application settings are read-Only
we cant assign value to them.
UserPreferenceSample.Settings defaultSettings= new Settings();
defaultSettings.FormForeColor = this.ForeColor;
This code ll give design time error.
Property or indexer 'project...' cannot be assigned to -- it is read only
if it is possible to assign value to application settings than please let me know how.?
Thanking you
|
|
|
|
|
shaktisinh wrote: Application settings are read-Only
we cant assign value to them.
Did you go through my article? I think it was clearly mentioned how the User Preferences can saved in Application Settings. Also, I have provided a sample application with source code. You can simulate the same thing there.
shaktisinh wrote: UserPreferenceSample.Settings defaultSettings= new Settings();
defaultSettings.FormForeColor = this.ForeColor;
Yes..It was a typo. I have modified the code in the article[^]. I have posted the updated article[^] in CodeProject also.
But I guess you have not opened my source code yet . There you should have got the proper code. Keep me posted on this. if this resolves your problem
|
|
|
|
|
And I thought my work was irrelevant. Try this article[^].
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
well im having listview problems.
my code is not letting me display a variable in listview subitem[3]
displaying the same varible in subitem[0] or [1] or [2] works fine, just 3 and onwards.
it says the index is out of range.
ive tried everything i can think of :S
heres my code:
public void button1_Click(object sender, EventArgs e)
{
{
int iCount = lvAccounts.Items.Count;
ListViewItem[] accUserPass = new ListViewItem[iCount];
lvAccounts.Items.CopyTo(accUserPass, 0);
for (int i = 0; i < accUserPass.Length; i++)
{
foreach (ListViewItem item in lvAccounts.Items)
{
// i defined my variables here
accUserPass[i].SubItems[2].Text = sec;
accUserPass[i].SubItems[3].Text = validpro;
}
}
ive manually defines column headers:
public RapidCheck()
{
InitializeComponent();
lvAccounts.Columns.Add("Login", 80, HorizontalAlignment.Left);
lvAccounts.Columns.Add("Password", 80, HorizontalAlignment.Left);
lvAccounts.Columns.Add("Security", 75, HorizontalAlignment.Left);
lvAccounts.Columns.Add("Expiry Date", 120, HorizontalAlignment.Left);
lvAccounts.Columns.Add("Rapidpoints", 80, HorizontalAlignment.Left);
lvAccounts.Columns.Add("Email", 80, HorizontalAlignment.Left);
lvAccounts.Columns.Add("Ref Points", 80, HorizontalAlignment.Left);
lvAccounts.Columns.Add("Files", 50, HorizontalAlignment.Left);
}
still not working :S
please help
|
|
|
|
|
You are asking to debug your code..
Anyway, from your code I can suggest some hint..
iNutR wrote: for (int i = 0; i < accUserPass.Length; i++)
{
foreach (ListViewItem item in lvAccounts.Items)
{
// i defined my variables here
accUserPass[i].SubItems[2].Text = sec;
accUserPass[i].SubItems[3].Text = validpro;
}
}
My observations -
1. Why do you need
for (int i = 0; i < accUserPass.Length; i++) ?
You already have inner foreach which should be enough.
2. If you use only one foreach (after removing the
for ), then you should use the
ListViewItem item instead of that array of things.
Keep me posted if this helps.
|
|
|
|
|
Check the number of subitems in lvAccounts I have the feeling that there will only be 1 Item and 2 subitems in the source listview.
Subitems are weird in a listview, IIRC it counts the item as subitem[0].
If accUserPass[i].SubItems[3] is missing you can use accUserPass[i].SubItems.Add().
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Been searching eveything I know to search and cant find anything specific enough.
Is there a way to make an XML file into a data source so I can take advantage of the Data-Aware capibilities in Visual Studio 2008.
I would like to use the Data Source and Data Navigator to develop a simple data entry form that had 6 data bound textboxs and a child DataGridView with the ability to add, delete and modify some small(300-500 items) xml files. In other words use the XML files like I would use SQL server.
Thanks in advance for any comments or suggestions and links to any examples would be helpful.
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Well sort of. I do not know of a way to do this directly, although there may be one.
However, the DataSet class has a ReadXml method as, I believe, does the DataTable class. Obviously they both also have WriteXml methods too. So you can create a DataSet, or DataTable, in memory and read the XML into it. From then on it is just like using SQL Server.
If you Google/Bing for dataset.readxml you will find loads of examples.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Found this if anyone is intrested...
Using XML as Database[^]
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Good afternoon.
We want a user to enter a date as 08/07/2009, but if someone enters 08/07/09 we want to format it correctly, but any other dates like 08/07 will be rejected. I know InfoPath automatically changes 09 to 2009 depending on the format of the field. What makes it additionally challenging, is if someone enters 08/07/20 (deletes the 09 in error), we wouldn't want it to format 08/07/2020.
Any suggestions? Thank you, WHEELS
|
|
|
|
|
While you can most definitely enforce the ##/##/#### format they could try British style dates. DateTime.ParseExact[^] can be used to check to see if it is valid. Any logic you want you will have to combine with if statements. I would recommend against and format input boxes as they always seem to cause problems. Now, using a DateTime picker with a custom format is also a perfect solution.
|
|
|
|