hericles 289 Master Poster Featured Poster

Wouldn't this be more easily done using javascript if you just need to display the div? Does your text box or div have server-side code attached to it which makes client side inappropriate?

hericles 289 Master Poster Featured Poster

How you retrieve the data from the database won't change but in terms of displaying it you could opt to use a repeater control (you've posted this in the asp.net forum so I'm guessing its a web app you're working on).
Whatever you choose (a datagridview will work just fine) you will want to alter the columns to display either text boxes or checkboxes depending on what you need. In the properties of the datagirdview you can specify what control you want to be in a particular column. After that, for text for example, the data from the database would be inserted into the text box rather than displayed as text on the page allowing it to be edited by the user.
I have some sample code on another computer that might be of use if you need more help.

Steve

hericles 289 Master Poster Featured Poster

Post up what you've done so far and we'll probably be able to help you out

hericles 289 Master Poster Featured Poster

Its pretty simple. Put the usual user name and password textboxes on your form and one button.
In the button code, connect to your database and see if the query to count the rows with that user name/password combination = 1.
Typing "csharp login code" into Google got plenty of tutorials and snippets. Have you tried that yet?

hericles 289 Master Poster Featured Poster

Sarama2030, there is quite clearly a <table> element at the start and a </table> element at the end. The OP is using document.write to insert the code between those two tags

hericles 289 Master Poster Featured Poster

When you say view the details and all three should be connected,I take it that the main location would simply need access to the database of locations B and C so it view data. Connecting to different databases is simple. You could add functionality to location A's software to access these other databases pretty easily by usng their IP address. A web service could do exactly the same thing, just store it where it makes the most sense (does location A have a web server running?)

As for your chat problem, I think we'll need some more information. You've tried it with both firewalls off?

Hope that helps,

hericles 289 Master Poster Featured Poster

This is probably because div is a block element, it doesn't want to aline things side by side. Add display: inline-block to your css for the divs and they should start to line up properly.

hericles 289 Master Poster Featured Poster

The problem lies in incorporating TextBox2.Text directly into your SQL statement. Use parametised queries to avoid the issue.

string sql = "SELECT ID,Firstname,Lastname,Email,Username,Password from student where Firstname= ?name;";
cmd.Parameters.Add("?name", MySQLDbType.Varchar);
cmd.Parameters["?name"].Value = textBox2.Text
SqlDataAdapter adap = new SqlDataAdapter(cmd);
hericles 289 Master Poster Featured Poster

And your error message was...?

hericles 289 Master Poster Featured Poster

Is this for a project of your own (i.e. on your own machine and you will be the only user) or an actual website posted live to other users? One option you could consider is posting the web page events to a database which the windows form checks at set periods (several seconds, minutes, whatever works for your needs).

hericles 289 Master Poster Featured Poster

I think you might want to handle the httpwebrequests asynchronously. The sleep() idea will never be the best option (at the least you would need to extend it to cover slow connections which leaves faster users needlessly waiting).
Look here: http://stackoverflow.com/questions/202481/how-to-use-httpwebrequest-net-asynchronously

hericles 289 Master Poster Featured Poster

Can't you simply do a string replace() on the resulting string to get the separator character you want?

hericles 289 Master Poster Featured Poster

You can use jQuery to make the contact section appear and disappear nicely. That way it would always be part of the page but invisible to the user until they click the button to make it appear. You could use straight CSS as well but jQuery has a prettier effect to it:)

hericles 289 Master Poster Featured Poster

Obviously when you use the asp:Button its ID is set to "btnclick", right? Because it isn't in the code you posted above.

hericles 289 Master Poster Featured Poster

A mysql connection string is normally server="" database="" uid="" pwd="". I could be wrong but I didn't think data source was valid.

hericles 289 Master Poster Featured Poster

And you're not going to give us any hints as to what the issue is? We'd be more inclined to help you if you point us in the right direction to start with

hericles 289 Master Poster Featured Poster

Running the same app twice at the exact same time to show sycnronisation issues? Can't you use one application with a couple of threads to do the same thing? At the very least you wouldn't have to jump between two IDEs.

hericles 289 Master Poster Featured Poster

Add this line:
dpDOB.Format = DateTimePickerFormat.Short;
to the code that draws the info from the database. Just place under the rest and it should work. The problem at the moment is that you only have it in the dateTimePicker code segment which is only getting called when you click on it.

hericles 289 Master Poster Featured Poster

Is the page list going to be static or dynamic? If the list can change over time the URLs will need to be stored somewhere. I'd be strongly inclined to use a database

hericles 289 Master Poster Featured Poster

You need to provide starting values for the millisecond and second when the countdown starts annd then resent those values again once a loop is finished. Inside the seconds loop reset the millisecond control to 100 after decreasing the seconds by 1 (otherwise the next millisecond loop has nothing to do), then reset the seconds to 60 after decreasing the minutes by 1.
Change your loop final to check for "0" instead of "00" to test it. You can also add code in to display "00" but check for "0" later if you want the digital clock look.

hericles 289 Master Poster Featured Poster

Your textbox is never going to equal "00". It will equal "0" however when it counts down (1 - 1 = 0, 1 - 1 != 00).
Also, at no point do you reset the seconds away from 00. E.g. 10.00.00 minus 1 sec doesn't seem to become 9.59.00 in your code.

hericles 289 Master Poster Featured Poster

Posting up your actual SQL statement would help us a lot

hericles 289 Master Poster Featured Poster

Your code seems to present the message box saying 'please enter a value' and then continues through the rest of the function after that. It doesn't exit to await new input. Also, you've nested your if loops. txtInWage.Text = "" is only tested if txtInHours.Text = "". Meaning txtInHours needs to equal an empty string before txtInWage is checked. If txtInHours has a value entered but txtInWage doesn't you've got a problem.

hericles 289 Master Poster Featured Poster

Once you have your files in a list you can loop through that list and use the getExtension method to return the file extension of each file. That will of course give you quite a few duplicates for each file type so you'd still need to filter that if you wanted a distinct list.

hericles 289 Master Poster Featured Poster

Do you mean you want drag-and-drop functionality on your web page? Try jquery, there is a good example of the plug-in here:
http://jqueryui.com/demos/draggable/

hericles 289 Master Poster Featured Poster

You have looked at the most likely causes given on the error page? And tried the 'things you can try' hints also on that page?

hericles 289 Master Poster Featured Poster

Or try here:
http://msdn.microsoft.com/en-us/library/ms172541(v=vs.80).aspx

Or, try typing windows smartphone development into google and find other links

hericles 289 Master Poster Featured Poster

As I said earlier, if you are getting an actual error message please post it up.
Have you debugged the code to check if the data reader contains any results? Or is the error coming from the dr("staffid").ToString() part of the code?

hericles 289 Master Poster Featured Poster

If you're getting an actual error message it always help to post it up. It helps us know what is wrong.
I'm guessing there is more than one value in the staffid table of the database. If so, then looping through them all is a waste of time if you only want the highest one. Use "SELECT MAX(staffid) FROM staff" and you'll be returned the highest id currently in the database table and looping through them all is not needed.

hericles 289 Master Poster Featured Poster

Here is some code I used for an exercise program that recorded the user's workout (exercises, weights and reps) and stored it into an xml file under the "Weights" element.
Essentially it locates the element I wish to add the data ito ("Weights"), creates the new nodes and adds the attribute values to them and then adds the new nodes to the existing element.

There is a loop where I'm running through a populated dataTable extracting the data. ignore that and concentrate on the attribute and node creation/adding aspects and you should be able to follow it for your code.

XmlDocument doc = new XmlDocument();
                doc.Load("Users/" + profile + ".xml");

                XmlNodeList xmlNodeList1 = doc.SelectNodes("//Weights");
                XmlNode newNode;
                XmlNode setNode;

                // create elements, attributes and specify values
                XmlAttribute dateAtt = doc.CreateAttribute("date");
                dateAtt.Value = date;
                XmlAttribute weightAtt = doc.CreateAttribute("weight");
                XmlAttribute repsAtt = doc.CreateAttribute("rep");

                foreach (XmlNode existingNode in xmlNodeList1)
                {
                    newNode = doc.CreateElement("Session");
                    // child nodes of the newNode
                    
                    
                    // for loop cycles through ds dataset adding set elements as needed
                    // nameNode takes on datatable name value
                    // set element is added for each row in datatables
                    Int32 tables = ds.Tables.Count;
                    for (int i = 0; i < tables; i++)
                    {
                        XmlNode exerNode;
                        exerNode = doc.CreateElement("exercise");
                        XmlNode nameNode;
                        nameNode = doc.CreateElement("name");
                        nameNode.InnerText = ds.Tables[i].TableName.ToString();
                        exerNode.AppendChild(nameNode);
                        Int32 rows = ds.Tables[i].Rows.Count;
                        for (int x = 0; x < rows; x++)
                        {
                            setNode = doc.CreateElement("set");
                            weightAtt = doc.CreateAttribute("weight");
                            repsAtt = doc.CreateAttribute("reps");
                            weightAtt.Value = ds.Tables[i].Rows[x].ItemArray[0].ToString();
                            repsAtt.Value = ds.Tables[i].Rows[x].ItemArray[1].ToString();
                            setNode.Attributes.Append(weightAtt);
                            setNode.Attributes.Append(repsAtt);
                            exerNode.AppendChild(setNode);
                            newNode.AppendChild(exerNode);
                        }
                    } …
hericles 289 Master Poster Featured Poster

There are a few things. For a start you are only closing the connection if iRdr is true. If the user name or password does not match the connection stays open. Thats wasteful.
Secondly, you're inserting the actual text entered into the user name and password text boxes into your SQL statement. That is REALLY bad as it leaves you open to SQL injection attacks. If I were to type 'steve or 1 = 1;' into the user name texbox, your sql statement becomes "SELECT username, password FROM tableusername WHERE username = steve or 1 = 1. The 1 = 1 is always true and so I log in without needing a user name or password. Thats bad enough but I can make things worse by using DELETE statements. If I manage to guess or discover a table name, say goodbye to your data. Use parametized queries to avoid that whole mess.
Hope that helps:)

hericles 289 Master Poster Featured Poster

More paragraphs simply means a longer array.
Loop through it, doing your database insert operation on each array element. If you don't know how to do database inserts, google it. It isn't hard

hericles 289 Master Poster Featured Poster

If you are using firefox you can find the location of the cache by typing about:cache into the address bar. It will show you the folder location of the cache. The other browsers may have similar functions.
Basically, you should get steered towards the AppData folder of your PC (on Vista at least). I had a look at the firefox cache on my machine and it isn't a straight forward list of html/aspx/jsp/etc pages so I think you'll have some work to do

hericles 289 Master Poster Featured Poster

If you had 2 other textboxes this would split the text in the first textbox into paragraphs to be displayed in the other two. This splits whenever the enter key was hit which may not be exactly what you want.

Dim input As String
input = RichTextBox1.Text

Dim output As String() = input.Split(New String() {vbCr & vbLf, vbLf}, StringSplitOptions.None)

RichTextBox2.Text = output(0).ToString()
RichTextBox3.Text = output(1).ToString()

To save to the database simply go through through each item in the output array.

hericles 289 Master Poster Featured Poster

I think you need to explain yourself better. Do you mean how to retrieve the login details from a database to confirm they are registered users? What do you mean by 'any website'? When you say you want to save it to a text file I can only guess you don't have access to the database where the information is stored, otherwise that would be irrelevant.

hericles 289 Master Poster Featured Poster

You can simply break up the text by locating the relevant paragraph start points. For instance if you hit enter twice to designate a new paragraph you just need to locate the two carriage returns and line feeds in the text string.
If what defines a new paragraph isn't that clear cut you may have problems locating them.

hericles 289 Master Poster Featured Poster

Glad to help. I was also wondering how the help text was supposed to work if the button wasn't disabled. Then, clicking on it to get the help text would, of course, cause it to call whatever code it handles. Not very good from a usability point of view

hericles 289 Master Poster Featured Poster

You have to alter the names in some way. You can't have 2 files with exactly the same name in the same folder.

hericles 289 Master Poster Featured Poster

Tooltips aren't of any use to you? They display your help text when the control is hovered over

hericles 289 Master Poster Featured Poster

Why would someone click on a textbox that is disabled anyway? The whole idea of disabling the control is to show the user they can't interact with it.

hericles 289 Master Poster Featured Poster

You are passing in a value from the TMtNm.Text textbox right? If that was empty you would get an error similar to that.
I may be jumping the gun here but you also aren't taking care of many error conditions either. What if the material entered can't be found or the user doens't enter an integer into the amount textbox?

hericles 289 Master Poster Featured Poster

OK, cool. That example shows how to attach data to a web request and send it to a webpage. But what is the accept.aspx doing with the posted data? As I said before the receiving page needs to do something with the posted data. Have you added any code to your accept.aspx page to take care of saving the data? Where do you specify what file to save to?

hericles 289 Master Poster Featured Poster

Well, what is accept.aspx doing with the posted data? You can't just send data to the URL and expect it do what you want with it.
If you want to write to a file on the server, accept.aspx will need to get the posted data from the request and then save it to the correct location. Have you coded for it to do this?

hericles 289 Master Poster Featured Poster

I guess you could stop all client side scripts be going into IE's advanced settings and turn off all scripts and download options, even images if you wanted to go that far. But that will still let server side code run - if you want to stop ALL processing of the web page I don't think it can be done. The URL link requests a page and server sends it back. End of story.

hericles 289 Master Poster Featured Poster

Everything seems OK when I looked over it except, of course, you aren't actually inserting the data into the database. After setting the command text you need to include the line:
cmd.ExecuteNonQuery();
This is the command that places the data into the database. Also,you shouldn't enter the text provided by the user directly into the SQL statement. It allows for hacking attacks via SQL injection (read up on it - its useful to know about). Use parametized queries to avoid the problem.

hericles 289 Master Poster Featured Poster

You normally see that error when you have included a method to handle the ontextchanged
in the code behind. You have ontextchanged="vNaam_TextChanged" but haven't got code specified to handle that event.

hericles 289 Master Poster Featured Poster

Post some code up. You shouldn't have the code to retrieve the database info anywhere except being called by the search button if you want the user to add a filter and then evoke the search function. For the data to show up on loading the site you much have something in your page_load function that calls the database and links the results to the gridview.

hericles 289 Master Poster Featured Poster

You could adjust your loop so the fourth iteration uses write instead of writeline or whatever n is if it isn't always 4). Or add proper error checking code to your code that reads the files so it can recover from encountering an empty line (the fact that it crashes means you haven't coded for all eventualities).

hericles 289 Master Poster Featured Poster

Does the other computer have the .Net framework installed (rather than Visual Studio)?
It says file not found. You know your code, what file could it be looking for and not finding?

hericles 289 Master Poster Featured Poster

Try this:

SELECT t2.date, t3.order FROM Table1 As t1 JOIN Table2 AS t2 JOIN Table3 AS t3 ON t1.userID = t2.userID AND t2.customerID = t3.customerID WHERE t1.userName = 'name';

Use the JOIN and ON statements to connect tables by the columns they have in common (userID for tables 1 and 2, customerID for tables 2 and 3).
Hope that helps.