hericles 289 Master Poster Featured Poster

You might want to edit the post to remove your email and password...

hericles 289 Master Poster Featured Poster

Are you using the XML to hold data and need to put that data into your page? If yes, data tables can respond to XML just as easily as they use databases so you can use the XML as the data source for a repeater or grid view.
Or do you need to put the actual element names into the page, not just the element's contents?

hericles 289 Master Poster Featured Poster

Do you have a ThumbnailCallback function on your page? Going by the error message I'm assuming you don't.
This MSDN post might help you
http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx

hericles 289 Master Poster Featured Poster

So at the moment it is requiring you to enter all four pieces of information? Are you using validators? Because they will get in the way if you want to only work with some inputs. MAybe you could post up your code so we can get a look at what is going on?

hericles 289 Master Poster Featured Poster

Have you checked to make sure the dataTable actually has data in it?

hericles 289 Master Poster Featured Poster

You need to call dataBind() on the GridView to actually make it display the data. All you have done is tell what its data source is. Also, you don't need to specifically open and close a connection for a dataAdapter, it takes care of that itself so you're using two connections here when you don't have to.

Hope that helps,

hericles 289 Master Poster Featured Poster

An older version of MySQL would work fine, the issue isn't what database you use but how you make the remote application update, unless I've missed the point of the exercise. I wouldn't think database speed would be issue, both MS SQL and MySQL are used as production servers for massive databases.

hericles 289 Master Poster Featured Poster

Are you getting an error at the point of executing the query? Setting the SQL statement by the radio buttons is easy enough, I can't see what you're doing wrong there. You're not closing your connection when you're done either by the way:)

hericles 289 Master Poster Featured Poster

Hi,
I'm trying to debug an android app on a fairly crap tablet I have (WonderMedia WM8650) but I can't get my linux machine to recognise the device.From what I've read its a matter of including the USB vendor ID into the 51-android.rules file but I can't find out the USB driver for the tablet. Or maybe I'm doing it all wrong.

I have set the tablet to debug and configured USB to ADB but running the command adb devices doesn't show it. Are there other ways to get the device recognised or does someone know the vendor ID for this tablet?

Thank you,

hericles 289 Master Poster Featured Poster

I don't really understand the question but if there are fields you need the user to complete use required field validators to make sure they are filled out. You can also use range validators and regular expression validators to check for the format of the input.

Is that what you need?

hericles 289 Master Poster Featured Poster

Depends how you set up your code. You will obviously have a check at some point to ensure the user is correctly logged in so at that point you simply roll through the controls altering their enabled status to true.
I guess you could set up a function that toggles the state of the controls then you call the same function to disable or enable them and that would require an if statement. But this is probably not very relevant as I imagine the controls are disabled at page load and set to enabled after login and thats it, no more altering required.

hericles 289 Master Poster Featured Poster

Time to debug your bug and see what values are in DSO and dso_para. You can compare strings with strings (abc < bcd, etc) so in theory what you are doing is possible. But now you need to check if DSO IS less than dso_para as a string or higher as a double because if neither condition is true nothing will happen.
Don't worry about your if statement, I'm not sure what I was thinking at the time but if the first is true then the second one can't be so you don't need to check both. Had a mind blank:)

hericles 289 Master Poster Featured Poster

Most form controls have an 'enabled' property that you can set to false until the user is logged in as which time to switch them all to true. Buttons will be greyed out, text areas can't be clicked inside, etc.

hericles 289 Master Poster Featured Poster

You say it doesn't compare both data. By that do you mean check the string version is less than DSO_para and then check that the double version is > DSO_para? Because you use ElseIF statement which won't check them both..

Or is it not comparing the string version against the string and the double against the double in each If statement?

hericles 289 Master Poster Featured Poster

You don't need to use procs of course, but they are a tidy way to deal with problems like this. If you do want to use a database that does have procs you will need to use MSSQL or MYSQL, they'revery common and MYSQL is free!

Where you have "if result > 0" means a code has been found and the user is being redirected. This is where you want to remove the code as it has been successfully used. using procs or not, you will need to rework the code a bit to get it flowing smoothly. Slapping in your deletion code at that point I mentioned above wouldn't be very neat if using procs or transactions.

Hope that helps,

hericles 289 Master Poster Featured Poster

Create another command object that deletes the code from the table immediately after the insertion code is called. But make sure you wrap your insertion and deletion in a transaction to ensure if something goes wrong with the insertion the code remains valid for the user to try again, instead of getting deleted regardless of what happens to the insertion.

hericles 289 Master Poster Featured Poster

I think the easiest option might be to include a new table in your database that has the user ID and the time they executed the function (and other other functions that need the same restriction) and the function name. Then you can run a check against the table whenever a user tries. It should be fairly fast as long as you include code to regularly clear out the table.

hericles 289 Master Poster Featured Poster

Hi,
You can find plenty of code snippets on MSDN to help you with that. Here's one answer:
http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/91bd10ce-c83b-4766-920b-2137ddc29908

As for saving the image, there are two things you can do; save the name (and possibly file location if it isn't consistent) of the image to the database and save the image to a folder (always my preferred option) or save the image into the database as a blob data type.

Hope that helps,

hericles 289 Master Poster Featured Poster

Are you referring to adding an existing item to the project in the VS IDE? And you want to do that programmatically when the project is running? Because that would be the same as uploading a file or image and saving it. Is that what you want to do?

hericles 289 Master Poster Featured Poster

What exactly is no? Is it a column in the table?

hericles 289 Master Poster Featured Poster

You'll be coding not doing graphic design. As long as you know you have an issue with red/green colours you can work around it. I don't see that as a hinderance at all.

hericles 289 Master Poster Featured Poster

Use coalesce function of the ANSI standard.It will insert the value of count unless it is null, in which case it will insert your specified default value.

SELECT p.prod_id, desc, price, coalesce(count, 0) FROM product as p LEFT JOIN uiiage ON p.prod_id = uiiage.prod_id;

The LEFT JOIN maes sure you are including all rows from the table on the left (product) and joining uiiage to it where you can, which would leave NULLs where there was no match.

Hope that helps,

hericles 289 Master Poster Featured Poster

Use a CSS class and toggle the visibility (display: none) using javascript

hericles 289 Master Poster Featured Poster

Hi, you have logic errors in your code. You are loading up your dataTable with the data using the SQL statement: "Select * from admin" and then checking against the rows in the table in your foreach loop. You never use the command object to extract the users that match the user name and password; that code is being used by anything as you never reset the dataAdapter's command object to that.
But that won't be causing your code to fail. Have you checked Username and Password are holding the correct values?

hericles 289 Master Poster Featured Poster

Hi,
Setting the text property to = "" will achieve the same thing. To spend up the process of coding it up (and make your code easily able to handle a growing number of textbooks) use this code in your Clear button

Dim ctrl As Control
Dim txt As TextBox

For Each ctrl In Me.Controls
If (ctrl.GetType() Is GetType(TextBox)) Then
txt = CType(ctrl, TextBox)
txt.Text = ""
End If
Next

This will loop through all if the controls, find text boxes and change their text to "". Only useful if you want to clear out every text box though otherwise you would need to exclude any that held their values.
Hope that helps,

hericles 289 Master Poster Featured Poster

just make it an .aspx page. Be easier in the end.

hericles 289 Master Poster Featured Poster

Ae you using visual studio to build the pages? This should have been taken care of automatically. Your .aspx page needs a directive at the top pointing to the code behind file to use:

<%@ Page language="C#" codebehind="your .cs file" inherits="" %>

hericles 289 Master Poster Featured Poster

Are you referring to the exception code or the else for the dr.read()? Your catch block has an if loop in it which means if the catch block gets triggered it is not guaranteed to display that message.

You don't break out of the function if either of the text boxes are empty. As it is you alert the user that the password or login name is missing but then continue through the rest of the logging in procedure.
Try/catch blocks are expensive to use and you have 2, one of which is for nothing more than opening the connection. Combine the two. And use a finally() block to include the conn.close() if you want keep it down there. That will avoid it getting missed if your code gets more complicated (redirects inside the try block for example - the connection would not get closed in that case).

hericles 289 Master Poster Featured Poster

As mentioned earlier, you have onclick="" inside the asb:Button element on the page but no matching button function (button_onclick()) in your code behind. When compiling VS is looking for that function and not finding it.

hericles 289 Master Poster Featured Poster

If you are getting an error please include it in the post; but one solution would be to put the results from the first reader into a dataTable instead of keeping the reader open - so you would be better off using a dataAdapter to fill the dataTable. Then loop through the dataTable using the second reader as you have it here. I think closing the first reader as soon as you can might fix the problem.
Also don't use SELECT * from the database if you don't need all the data. It's lazy and bad practice:)

hericles 289 Master Poster Featured Poster

I may be wrong but from what I've read this isn't something you can request. Google applies it when your site reaches some level of page rank, authority or general market penetration.

hericles 289 Master Poster Featured Poster

Hi,
Break your search string into an array of words e.g. an apple would become an array with two items {"an", "apple"}. Check your second string for each item in the array by looping through it and if it is true in every case you have a match.

for(int i = 0; i<array.length;i++) {
   if(string2.contains(array[i]) {
      boolean == true
   } else {
      boolean == false
   }
}

If the boolean value every becomes false you don't have a match.
Hope that helps,

hericles 289 Master Poster Featured Poster

What line in your code throws the error? I'm guessing it is when you try to use data extracted from the database which would indicate something about the extraction isn't working, maybe an incorrect connection or the data isn't in the database on your production server

hericles 289 Master Poster Featured Poster

So you aren't logging when the user's use the Internet? Your reduction function run once a day and check the log for who has actually logged in - it sounds like your logic is missing a very important step...

hericles 289 Master Poster Featured Poster

I'd be tempted to do this client side in javascript. If need be you can call a function at the bottom of the page (to ensure everything has finished loading) and alter the position of the div if necessary.

Of course, you could make this work (probably, I haven't tried it) through good use of CSS and applying the right class to the div and text box when you create them

hericles 289 Master Poster Featured Poster

You want to have a simple mouse over effect or something more stylish like lightbox (larger image is displayed but background darkens)

hericles 289 Master Poster Featured Poster

In terms of coding functionality there is little difference between a Windows form app and a web app. The code can do similar things. Think more about how you want to distribute the app, how/where the user will access it, user's level of competence (most people have grown accustomed to browsers and have less of a learning curve when faced with new online apps).

hericles 289 Master Poster Featured Poster

Each question will have its own radio group so when the submit button is clicked you will need to go through each radio group and find the selected item. This will have to matched against the correct answer, possibly an array holding question number and correct answer. From there keeping a tally of the correct answers is pretty simple. The only real complexity arises if the number of questions on a page isn't set (the same for all time) as then you will need to dynamically determine the number of radio groups on the page.
If you need more input than that post up what you've done and we can have a look.

hericles 289 Master Poster Featured Poster

You will want to use javascript. The onmouseover and onmouseout commands can be used to call the javascript functions you want to alter the image.
A very simple example would be something like this:

<HTML>
<HEAD>
   <TITLE>Untitled HTML Document</TITLE>
   <script language="javascript">
   function largerPic() {
      var img = document.getElementById("image1");
      img.src = "IMG_2145.jpg"
      img.style.width = "300px";
   }

   function smallPic() {
      var img = document.getElementById("image1");
      img.src = "IMG_2146.jpg"
      img.style.width = "200px";
   }
   </script>
</HEAD>
<BODY BGCOLOR="white">

<a href="#" onmouseover="largerPic();" onmouseout="smallPic();" ><img id="image1" src="img1.jpg" /></a>
</BODY>
</HTML>

You can use the height properties to alter the image if you need to as well (style.height).
Hope that helps,

hericles 289 Master Poster Featured Poster

You're going to have to post up your code. We can't tell what you've done wrong by looking at the tutorial.

hericles 289 Master Poster Featured Poster

If you have created the view in a nib file then you load the view from the current one. Inside the code for the button press you would have something like:

UIView *quizz = [[UIView alloc] initWithNibName: @"qizzView" bundle: nil];
[currentView addSubView:quizz];

Or possibly the superview would add the subview depending on how you have it set out and want the views to display.

hericles 289 Master Poster Featured Poster

Thats a client side action so you will want to use Javascript (unless you are planning on having a page refresh or AJAX call on every key stroke)

hericles 289 Master Poster Featured Poster

Have you debugged this? Is the SQL code even being called? Where abouts in the page life cycle is this code being called (Page_load or else where)?

hericles 289 Master Poster Featured Poster

Hi,
I'm assuming the exam will be multiple choice to allow for automatic marking. You will need a database table with columns for question id, the actual question text, n number of columns for the text of the possible options (a,b,c,d, etc) and a column containing which answer is correct (or possibly anothe table for this depending on your design.

After that, you need to pull the questions and answers from the database, display on the page and record the user's answer. Obviously this all can vary depending on if you present one question at a time or show several on one page, whether the questions are shown in random order, etc.

Hope that helps,

hericles 289 Master Poster Featured Poster

If you want to stay open source and platform independent Java is the way to go. But all the high level languages teach you the same skill set. Once good at one, you can pick up the others pretty easily. I know .Net the best and am capable at Java and because of that I picked up objective c (for iOS) in a couple of weeks. Pick a language that suits you, you won't be limited once you are proficient.

Hope that helps,
Steve

hericles 289 Master Poster Featured Poster

A datagridview populated by a dataTable and and dataAdapter will probably be what you want. Check them out on Google, you're find plenty of tutorials to show you how they work.

hericles 289 Master Poster Featured Poster

Could you provide any more information on exactly what you want to achieve? Do you want the users to be able include smart tags in their searches (like before: and after: to limit by date for example)?

hericles 289 Master Poster Featured Poster

Hi,
For your first question, it should work fine depending on the logic you use of course. You could query strings or session to pass user data around if you need to move from page t page however.

You can put a log in control wherever you want. I find including another page just to hold two text boxes and a button is a waste so I normally include the log in area on the top right and once logged in this area can hold basic account info (whatever seems relevant) and a log out link. This may best be done using a user control and some custom code of your rather than the actual .net login control. I hardly use that.

Hope that helps,
Steve

hericles 289 Master Poster Featured Poster

I had this problem once and although my solution probably isn't the correct one, I had a hidden field with a textbox (not a label) to hold the value. While label text updated via javascript doesn't seem to be available server side, the contents of a textbox is.

Hope that helps,
Steve

hericles 289 Master Poster Featured Poster

Do you have any more information? Does the current form hide but the log in form not display? Does nothing happen at all?