Sounds like your talking about XML here but nothing is clear at all.
Can you state what your working with and show us the data and where the issue is occuring.
Then we may be able to assist further.
Sounds like your talking about XML here but nothing is clear at all.
Can you state what your working with and show us the data and where the issue is occuring.
Then we may be able to assist further.
Hehe good to see you got there in the end :)!
Yeah dont' worry I won't be going anywhere, need something to pass the time at work when its quiet ;)
Whats the CashAccRef declared as in the database? What type? As I assume its going to be a mismatch between what you are passing and what it expects.
Im pretty sure it will be similar to the ListView approach, using a SQL query with a variable added in passing a primary key of some sort.
Ah that would explain why it makes me appear logged out on that page then :) Had a feeling it would be static.
At it'll match the rest with the facebook login added.
If you choose the former, go ahead and join the forums whiners.com.
I tried, the work proxy filters blocked me :( Must be a sign it was not meant to be!
Just noticed this, but is it intentional that if a user is logged in, and happens to stumble upon a broken link (ie. here (given for replication)), that the 404 page bar at the top acts as if you are not logged in and gives the option for member login?
It is also worth noting this page doesnt offer the facebook member login (if it is intentionally displaying the login) instead only the old style username login.
<xs:element name="code">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z]{4}[0-9]{4}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Try that.
I did it a different way yet again, probably more inefficient but still works.
class Program
{
static string[] LinesOfTextFile;
static string[] SortedList = new string[5];
static void Main(string[] args)
{
Console.WriteLine("Starting the sort.");
Console.WriteLine();
string[] OutputOfSort = RipFileAndSort(@"C:\Users\maskew\Desktop\Test.txt");
Console.WriteLine();
Console.WriteLine("Finished the sort.");
Console.WriteLine();
foreach (string TextString in OutputOfSort)
{
Console.WriteLine(TextString);
}
Console.ReadLine();
}
public static string[] RipFileAndSort(string FilePath)
{
StreamReader FileReader = File.OpenText(FilePath);
LinesOfTextFile = FileReader.ReadToEnd().Split('\n');
for (int i = 0; i < LinesOfTextFile.Length; i++)
{
int VotesReceived = GetVoteNumber(LinesOfTextFile[i]);
for (int j = 0; j < SortedList.Length; j++)
{
if (SortedList[j] == null)
{
SortedList[j] = LinesOfTextFile[i];
break;
}
else
{
if (VotesReceived > GetVoteNumber(SortedList[j]))
{
InsertStringIntoArrayAbove(LinesOfTextFile[i], j);
break;
}
}
}
}
return SortedList;
}
public static void InsertStringIntoArrayAbove(string StringToInsert, int PositionToInsertInto)
{
string HoldingLocationOne = null;
string HoldingLocationTwo = null;
HoldingLocationOne = SortedList[PositionToInsertInto];
SortedList[PositionToInsertInto] = StringToInsert;
for (int i = PositionToInsertInto + 1; i < SortedList.Length; i++)
{
if (HoldingLocationTwo != null)
HoldingLocationOne = HoldingLocationTwo;
HoldingLocationTwo = SortedList[i];
SortedList[i] = HoldingLocationOne;
if (i != SortedList.Length - 1)
HoldingLocationOne = SortedList[i + 1];
}
}
public static int GetVoteNumber(string SongEntry)
{
return Convert.ToInt32(SongEntry.Substring(SongEntry.LastIndexOf(':') + 1).Replace('\r', ' '));
}
}
This works by loading all the strings into one array, and then one by one loading them into the final array, by extracting the vote number and then comparing it to the current array entry. If the votes is higher the entry is put there and the rest of the array is pushed down one. …
I like the song list :)
What happens if two songs have identical votes? Whats the sort done on then?
So... I must not be reading the other part of the SQL Correctly. I'm not to sure what
this part means.. ={0} ?? what is this trying to reference?
Right to explain this. The following two lines of code do the same thing.
Console.WriteLine("The cat sat on" + " the " + "mat.");
Console.WriteLine(string.Format("The cat sat on {0} mat.", "the");
Basically the second line allows you to insert the values after the actual text string, so in the above case, the string "the" is added where {0} is. For longer strings with multiple entries it is simply comma-seperated values after the string like so:
Console.WriteLine("The {0} sat on the {1} and the {2} ate it.", "cat", "mat", "dog");
Obviously the strings can be replaced with any sort of variable, in your case the .Tag
property.
Basically it keeps strings cleaner that concatenating everything with +
'
Watch box would be empty if you didnt add any variables into it to watch :)
Well it depends what your trying to do with the logic. I would declare it as false, so that it always runs on the first attempt.
But then you would need to put the code below that into a new if statement checking the variable again else it would never reach that logic due to the first part of the if statement being run.
Not related to the question but:
private bool GetValues()
{
bool isValid = true;
if (isValid == false)
{
isValid = IsAllDigits(txtBoxEmpID.Text);
MessageBox.Show("Please Enter Valid Digits for Employee Id");
}
You will never hit the line isValid = IsAllDigits(txtBoxEmpID.Text);
because your setting the variable to true
in instanciation and then immediately checking its false. It will never be false as nothing has the chance to change it.
Right im fast running out of ideas at the moment :D
Have you checked the SQL string at run time is correct? Ie. the .tag
is correctly being passed into the sql.
Its declared but isnt instanciated (I could be completely wrong here, and it wont make a difference) but try: DataTable cashOrderTable = new DataTable();
on line 15.
Indeed, I can't even narrow down if its a plugin on my browser because just cant tell if its intermittent at that point or not.
Hmm outside my knowledge on how to get the exact string, my attempts have failed so far.
have you checked inside the dataset table yet like I said 4 posts up?
cashOrderTable
is not declared as a new datatable prior to use. Im guessing that might be it? Unless that is declared and instanciated elsewhere?
Haha who knows, S$#t happens. :D
I completely missed the If statement sorry.
I happen to be using that identical line structure in the code im working on currently and declaring the datarow and instanciating with the .NewRow()
works fine for me.
In the watch window look at cashCustomerDS.Tables[0]
see what it contains.
And what happens when running this? It should just show a message when you select something new stating the tag and name.
dRow would be null as its not past the instanciation line (the one its exceptioning on).
I believe you will find the dataset table your doing the .NewRow()
on to instanciate the dRow will be the null object.
Your welcome, mark the post as solved please :)
So just the title info?
Sorry the explanation confused me xD
It would be the a reference to the column holding the customerID.
and yeah I know the brain fried feeling..
Hmm for me its tempomental. Works sometimes with plugins, doesnt work others. Without plugins it originally worked on first disable, now it doesnt work with all disabled also.
Version: 14.0.1
I never had it work for me no, I was running through works proxy server at the time though. Will check the version when im in the office tomorrow
Kind of makes sense.
Yes you would have to run the listview populate before you could save because this is where all the tables are added.
Until this is done the dataset would appear null.
That the right understanding?
Ummm.. listView1.Items[listView1.Items.Count - 1].Tag = x
That line would be added into the current for-each loop.
Shouldnt do, might be worth dropping a break point in the save method and having a look at what the dataset actually contains.
Its not to do with the fact the table your making the new row from is referred to as orders.cashCustomers
is it?
Your then adding the row to cashCustomers
.
Ok so I achieved a similar effect using the ListView's tag property.
This is how I added some fake data, its an adaption to your code shown in post #1
edit: by which I mean the for-each loop, the table structure is identical to my above post, I continued using all that code to do this :)
foreach (DataRow row in DS.Tables["NameTable"].Rows)
{
ListViewItem temp = new ListViewItem();
temp.Text = row.ItemArray[1].ToString();
temp.Tag = row.ItemArray[0].ToString();
listView1.Items.Add(temp);
}
This hides the ID in the tag
property of the individual item on the listview.
You can then adapt my code in the ListBox post to instead look at the tag property of the selected item to view the ID and carry out the SQL.
Used this line to check the tag worked etc on ListView selected index changed
foreach (ListViewItem item in listView1.SelectedItems)
{
MessageBox.Show("Tag: " + item.Tag + " | Text: " + item.Text);
}
Hopefully that might work :)
On a seperate note - your welcome Mark :) Good ol' waiting on email replies giving me time to write this
Well thats the best blunder I've pulled off on this site... Skimread the question and never re-read it!
Gimme a while and I'll try figure it out :)
Looks quite interesting actually, what platform is it?
Pretty neat.
Thank you. I just added a small spiel to my last post, but it looks like you already covered it.
;) just thought I'd add my pennies worth.
Im with nmaillet on this one, I would personally prefer to have the validation fire on button click. This would allow use of errorproviders locally to each textbox to state which is causing issue.
Also the suggestion of using the leave event forces the user to complete one textbox at a time. Once they select one they must enter valid data before advancing. As a user I would find this quite unprofessional and irritating. Specially when one couldn't remember, say a credit card number on an online shop, so went to fill everything else out first, oh no im locked into the number field.
Would be better practice not to force the user.
Ok sorry for this not being actual code but its quicker for me to write to the code in a descriptive process and answer questions than mess around with setting up fake datasets and then try to SQL them (been trying for the last 20 mins and failing).
To bind a listbox to a data source.
Dataset: DS
For example we have a table called CustomerTable
with two rows CustomerID
and CustomerName
, will assume we have already run the SQL to select this information and it is in the dataset DS
And a second called OrderTable
with rows OrderID
, CustomerIDFK
and ItemID
which we will be running SQL off.
Our listboxes are List1
and List2
.
To setup our first list with the customer names and their ID's as the selected value:
List1.DataSource = DS.Tables["CustomerTable"];
List1.DisplayMember = "CustomerName"; //The column name as a string
List1.ValueMember = "CustomerID";
So now in the SelectedIndexChanged
action of the listbox List1
we will run an SQL query to the second table.
string SQLToRun = string.Format("Select * From OrderTable Where CustomerIDFK = {0}", List1.SelectedValue); //The string.Format allows use of {0} and then specifying the value after the end of the string, makes it a bit tidier than cutting off the string at '=' and then concat'ing the .SelectedValue in
This would return all the rows matching the CustomerID selected in List1 (it probably wouldnt as im rusty with SQL but oh well!)
And then following the same steps as with List1
we …
Could you not store which image is selected in a Session? and then pull up the correct image on the next page using the session value?
(don't do much ASP.Net work so cant remember if this works)
Depends how bad the day was.
Sometimes trance can lift me out of a bad mood, other times I just go back to my teenage years and whack the metal on.
@nmaillet, Didn't know you could leave the second part of the count specifier blank for any amount :)
@nesa24casa - the fix for my solution with your updated requirements using nmaillet's capturing. Also made it so it captures both <tab>
and \t
for the sake of covering all options :) simply remove |<tab>
from the regex if you dont need it covered
string inputString = "nesa\t\tpera<tab><tab><tab><tab>nn\t\t\t\t\t\tkkn";
string regexMatch = "(\t|<tab>){2,}";
string regexReplace = ",";
I've also noticed firefox doesnt allow file uploading, the way round it is to edit the post after submission and then add the file in there.
Agree with 1 and 3B WaltP, most practical solutions.
Realised the reason I dont see this message is because someone else ressed the post, and therefore the thread was counted as 'active' in the last three months = no message warning of thread age. Perhaps changing it from inactivity period to age would be more appropriate? (Except this probably wouldnt work so well in the geek's lounge etc with the long posts and also posting games forums)
Yes I thought to myself as I was writing it that there were times, but could only thing of a small few.
I will look for this big message next time!
That works too :)!
I will try to get back to you this afternoon, work is busy.
Else I'll write up an example tomorrow :)
Sorry for the inconvienience.