hericles 289 Master Poster Featured Poster

Hi,
I'm guessing it wouldn't really work but I've never tried it myself. I think you would need to break up the datagridview too much for it to still work. Up and down arrows aren't an option? That probably isn't as user friendly as you had in mind though.

Hope that helps,

hericles 289 Master Poster Featured Poster

The general SQL formual is:

SELECT SUM(expression )
FROM tables
WHERE predicates
ORDER BY predicates;

So, in your case, you might want:

SELECT transaction_id, SUM(amount)
FROM mytable
ORDER BY tranaction_id

You may or may not want the transaction_id as a SELECT column. You can just take it out if you don't.

hericles 289 Master Poster Featured Poster

The image is the top left is a .ico file (icon) so you need to look online and find a tool for converting animated GIFs to animated ICOs.
I found one site but haven't tested it
http://www.animatedfavicon.com/

They have an animated favicon though so I would expect it should work:)

hericles 289 Master Poster Featured Poster

Hi,
C# is one of the languages you can program in using ASP.Net, the other is VB.Net.
They both achieve the same thing as they compile the same. Your other main options include Java (JSP's) and PHP, especially if you want to use linux.
The real question is what are you comfortable coding in? The end result will be almost exactly the same regardless of the language you use to code your project.

hericles 289 Master Poster Featured Poster

We will need more information than that. What exactly are you stuck on? Have you got any code done that maybe causing a problem? If you are after general help about payment portals (such as PayPal, NoChex or something similar) I would suggest reading their documentation first.

hericles 289 Master Poster Featured Poster

hi,
This SQL query will help you

SELECT count(*) TABLES, table_schema
  FROM information_schema.TABLES
    WHERE table_schema= 'YOUR DATABASE NAME'
      GROUP BY table_schema

It gives the number of tables in the database you specify. Worked for me:)

hericles 289 Master Poster Featured Poster

You could consider using a linkbutton. Then you can pass the gallery id via the command argument of the link button.

<li class="gallery">
<a style="text-decoration:none;" href="galleryData.aspx?gallery_id=<%#Eval("gallery_id") %>">
<img alt="<%#Eval("gallery_name") %>" style="border:0px;" src="photo_load.aspx?gallery_id=<%#Eval("gallery_id") %>&thumbnail=1" />
<span class="below-image"><%#Eval("gallery_name") %></span>
</a>
<asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="<%#Eval("gallery_id") %>" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
</li>

And then in your code behind access the commandArgument of LinkButton1.

hericles 289 Master Poster Featured Poster

inside your checkbox_CheckChanged method do this:

if(checkBox.checked) {
  button1.enable = true;
  or button1.visible = true;
} else {
  button1.enable = false;
  or button1.visible = false;
}

Thats c# code anyway. You get the idea

hericles 289 Master Poster Featured Poster

What on earth is this? A table of contents?
You can benefit from our help better if you actually phrase a question...

hericles 289 Master Poster Featured Poster

Oh I see. If you want to return a lot of data use a dataadapter

SqlCommand cmd = new SqlCommand();
cmd.Connection = cnn;
cmd.CommandText = "Your sql statement";
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
adapter.Fill(dt);

You can remove you cnn.Open() and cnn.Close() as the DataAdapter takes care of that itself. You end up with the data you extracted from the database in the dataTable.

Hope that helps.

hericles 289 Master Poster Featured Poster

You could always change your code to be:

Catch ex As Exception
MsgBox(ex.Message)
Finally

to actually see what exception is being caught.

hericles 289 Master Poster Featured Poster

Hi,
You'll want to look into using a hash function against the entered password and then saving the hashed version in the database. Then, on logging in, hash the supplied password and check it against the hash in the database.
Check out tutorials for MD5 and SHA1 online

hericles 289 Master Poster Featured Poster

First question is - are you sure the reader is holding more than 1 row? If not, that would explain the single loop.

hericles 289 Master Poster Featured Poster

Hi,
I'm with adam_k; why isn't a new table per user being used instead of an entire new database per user - that seems excessive. If you do need different tables you will need to figure out a naming strategy that will create unique names (but still following some set rules as you'll obviously need to access these databases again at some point).
A better understanding of what you're trying to store would help us out.

hericles 289 Master Poster Featured Poster

Reply to what? All you did was post up some code without a question...

Unhnd_Exception commented: Absolutley no reason for this down vote. Some doom puff wanting to make them selves feel better. +8
hericles 289 Master Poster Featured Poster

Is this project involving databases or do you simply need two Acccount instances created that communicate?
If the later you need to create your Account class with methods (getter and setters) that alter the current amount (which will be a class variable).
Create the two classes, initialise each with a certain amount and then call your withdraw and deposit methods.

public class Account
        {
            private float balance;
            public void Deposit(float amount)
            {
                balance += amount;
            }

            public void Withdraw(float amount)
            {
                balance -= amount;
            }

            public void TransferFunds(Account destination, float amount)
            {
                this.Withdraw(amount);
                destination.Deposit(amount);
            }

            public float Balance
            {
                get { return balance; }
            }
        }

And then access like so

Account target = new Account();
target.Deposit(300.00F);
public void Withdraw()
        {            
            float amount = 200.00F; 
            target.Withdraw(amount);
        }

You were in luck, I had an old test case example lying around:)

hericles 289 Master Poster Featured Poster

Hi,
I'm confused. The specs say quite clearly that Office 2007 isn't supported but is that a problem? You don't intend to use it with Office do you, only your own program? If that program doesn't incorporate with Office 2007 you don't have a problem.

The fact that Office 2007 isn't supported won't stop you installing it on your XP machine. It just means that, once installed, it won't work with Office but it will work with everything else that DOES support it.

hericles 289 Master Poster Featured Poster

I think correct indenting is easier to understand than the numbers beside them and is a habit you should get into. Other coders will expect to see it.

hericles 289 Master Poster Featured Poster

Basically you are holding two versions that are the same in the GAC and windows is confused as to which one to use.

Look here for a solution:
http://dotnetfish.blogspot.com/2007/09/type-xxx-exists-in-both.html

Did you try google before posting this? Took me 20 secs.

hericles 289 Master Poster Featured Poster

Are you asking for the SQL command text that extracts the price and image url using some filter as parameters?
If yes, and assuming you use the stock code to find the product you would do this:
I'm using MySql as you didn't specify the database you are using.

MySqlCommand cmd = new MySqlCommand();
cmd.Connection = // your connection string
cmd.CommandText = "SELECT price, image FROM yourTable WHERE id = ?product_id";
cmd.Parameters.Add("?product_id", MySqlDbType.Varchar (or int if that is what you are using)
cmd.Parameters["?product_id"].value = variable holding product_id

Open your connection and execute the command on a dataadapter or reader to hold the results and then use them.

Of course, I maybe way off base because your question isn't very specific.
Hope that helps,

hericles 289 Master Poster Featured Poster

This isn't recursion at all. Recursion is the act of a function repeatedly calling itself until its task is done.
In your example, if you wanted to fill an array of length 10 with the letter X then you would have a function:

fillArray(string x, int i) {
   a[i] = x;
   i++;
   fillArray(x, i)
}

Of course this needs more code to know when the array is full but hopefully you get the idea. Your function needs to call itself to be considered recursion.

hericles 289 Master Poster Featured Poster

Definitely is possible but its a javascript thing not an asp.net thing. Look into jQuery, I think that was the library I used when I put it into a project. You would probably need to call the javascript from .net if you are using AJAX for page refreshes.

I found this tutorial on the net in a couple of seconds:
http://www.switchonthecode.com/tutorials/javascript-tutorial-simple-fade-animation

Hope that helps,

hericles 289 Master Poster Featured Poster

One last thought on the topic. The SelectedItem object will give that error if you haven't actually selected an item before clicking on the buttons. So if you are clicking on Button5 or Button6 before clicking on an item the program will crash with that error.
Either have one item selected as default when the page loads or include a check to see if ListBox1.SelectedItem is null when checking the SelectedItem.Text

hericles 289 Master Poster Featured Poster

My bad, I just did a test project cause I haven't used VB.Net for a while (mainly use C#). It works with just one = which means something else is going on to cause your first error.
Object reference not set to an instance of an object normally means the object has not been created yet but I can't see how that is the case in your code as the ListBox1 is defined in the page.

hericles 289 Master Poster Featured Poster

Thats very minimal concern. One connection object lingering until it gets garbage collected isn't going to be a problem. I don't have a very deep understanding of garbage collection (never really needed to dig into it) but the .Net version is apparently efficient.

hericles 289 Master Poster Featured Poster

You need to use == there as you're not setting ListBox1 to be "", you're checking the value.
Sorry I should have noticed that before.

hericles 289 Master Poster Featured Poster

Hi,
I would avoid making the database connection global to your application. One way to achieve what you are after is to create a database that creates the connection for you.
Then when you need to access the database, instantiate the database class and use the connection it provides.
I wouldn't be too worried about the resource cost of doing this. Its better than passing around the same single instantiated connnection object.

hericles 289 Master Poster Featured Poster

Hi,
I think you need to use ListBox1.SelectedItem.Text.
I assume you're getting stuck here:

If ListBox1.Text = "" Then
MsgBox("A file needs to be selected...!")
End If

ListBox1.Text isn't the best option. ListBox1.SelectedItem.Text matches the actual value selected from the list.

hericles 289 Master Poster Featured Poster

Hi,
With no code to go on I'm speculating but have you got the code to upload the file in the Page_Load method? if so, and you don't want the action repeated, you need to put the code inside of

if(!Page.IsPostBack) {
// your code
}

This means your code is only called the first time the page is loaded. Subsequent reloads (postbacks) skip the code.

Is that what you need?

hericles 289 Master Poster Featured Poster

Hi,
Clear out your listbox before you start adding the files to it

ListBox1.Items.Clear()
For Each file In ftpFiles
   ListBox1.Items.Add(file)
Next

This empties the list of the previous inputs so when you reload on the page refresh the previous items aren't doubled up. ListBox1 holds its contents through a page post back.

Hope that helps,

hericles 289 Master Poster Featured Poster

Hi,
It appears you are missing the UpdatePanel and ContentTemplate required to show which parts of the page are updated by the AJAX request.

Change your code to this and it should help:

<asp:Panel ID="bt" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel runat="server" id="updatePanel1">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" OnTick="tick" Interval="50">
</asp:Timer>
 
<asp:Label ID="time" runat="server"></asp:Label>
</contentTemplate>
</asp:Panel>

Let me know if that works,

hericles 289 Master Poster Featured Poster

The developer APIs for Facebook and Twitter can do a lot of things. They'd be a good place to start. 30 secs on Google told me it is possible to update Facebook status via their API.

hericles 289 Master Poster Featured Poster

Hi,
I'd use an image, unless you intend for there to be text on the lines that is following the curve. Twiss's comments above won't help you as he ignored the changing line ends give the curve you have in your code.

hericles 289 Master Poster Featured Poster

Hi,
What browser are you seeing this in? I just copied this code and tried it in IE, FF and Chrome and it looked OK in all of them.

hericles 289 Master Poster Featured Poster

Hi,
The only place you're using an integer that cause the out of range exception is when you refer to field(1) or field(2). So I would check that your field, when split on the comma character actually has 3 resulting splits e.g. 2 commas are in the initial line.
Otherwise, if your line was "hello, goodbye" for example, there would be no field(2), just field(0) and field(1).
Hope that helps,

hericles 289 Master Poster Featured Poster

Hi,
I wouldn't make hitting the enter key tab the focus to the submit button because all the user is going to do is hit the enter key again (being unaware that the use of it is not allowed in the textbox) thereby submitting the unfinished textbox.
You could look at why the carriage return is causing an issue and deal with that or parse the text when it is being submitted to replace carriage returns with something else (<br /> if you're doing something in a browser).
The problem with your code above is that it isn't telling the carriage return to not be entered, its saying move focus AS WELL AS enter carriage return.

hericles 289 Master Poster Featured Poster

Everytime I have had this error (usually moving my project to a production server just like you did) it is always because I haven't updated the connection string in the web.config to point to the new database. Or it could be the database hasn't been created on the production server.

hericles 289 Master Poster Featured Poster

Hi,
To check something has been entered in the new and confirm textboxes use a required field validator on both and a compare validator on one (to make sure the text entered in it matches the text entered into the other). These validators will validate when the button is clicked and so you don't need to handle them in your code when updating. If there is a problem the code to change the password simply won't get called. The only thing left to do is get the current password from the database, check it against the current password the user entered and if they match, proceed to storing the new value.

Hope that helps,

hericles 289 Master Poster Featured Poster

Hey,
I've been working on a product display page that lists product info and images via a repeater control. That all works fine. What I'm doing now is adding some new functionality that uses a link button to send the product code clicked on to the server (via AJAX, to add it to the order).
I'm trying to send the quantity entered into a textbox as the command argument of the link button but can't find out how to access the textbox value.

So far I have:
<div class="quantityDiv" id="Q<%# DataBinder.Eval(Container.DataItem, "product_id")%>">
No:&nbsp;&nbsp;
<asp:TextBox Rows="5" size="5" ID="tbQuantity" runat="server" />
&nbsp;&nbsp;
<asp:LinkButton ID="lbAdd" OnCommand="addToOrder" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "product_id")%>' CommandName='<%# Eval(Page, "tbQuantity" )%>' runat="server" Text="Add" OnClientClick="hideQuantDiv();">
</asp:LinkButton>

Its only the Eval for the textbox that is giving me trouble. From hints on the net I've gathered that databinding of the page is possible but I haven't found out how to do it.

Any advice?

Thank you,

hericles 289 Master Poster Featured Poster

Hi,
I've just downloaded GNUstep onto my Vista machine, installing the GNUstep MSYS System, GNUstep Core and GNUstep Devel components mentioned on theGNUstep website (http://www.gnustep.org/experience/Windows.html). I installed into the standard folders but when I try to open the shell for GNUstep the window flashes up and disappears again.

I've checked the PATH variables and minGW.exe and the GNUstep components show correctly.
I've found very little on the net to help with the problem. Can anyone provide some advice as to what could be wrong?

Thanks in advance,

hericles 289 Master Poster Featured Poster

I take that back - it now works with the ajaxToolkit:ToolkitScriptManager in place of the standard ScriptManager. Problem solved

hericles 289 Master Poster Featured Poster

Update: I discovered the ajaxToolkit script manager and tried that but nothing changed...

hericles 289 Master Poster Featured Poster

Hi,
I'm having trouble getting the Ajax Toolkit autocomplete extender to work. I have the web service set up as its own file in the same project and calling that alone works - the correct list of results is output as xml.
But when entering text into the textbox nothing happens. I don't know if the web service isn't been called or whether the response isn't being displayed.

Any help would be appreciated. Here's my code:

The web page:

<form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" >
        <Services>
            <asp:ServiceReference Path="AutoComplete.asmx" />
        </Services>
    </asp:ScriptManager>
    <div>
        <asp:TextBox ID="tbProduct" runat="server" autocomplete="off" />
        <ajaxToolkit:AutoCompleteExtender ID="autoComplete1" runat="server" TargetControlID="tbProduct" ServicePath="AutoComplete.asmx" ServiceMethod="getProducts" EnableCaching="true" />
    </div>
    </form>

The ASMX (which works fine on its own)

using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
using MySql.Data.MySqlClient;
using System.Configuration;

[WebService(Namespace = "http://tempuri.org/")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

[System.Web.Script.Services.ScriptService]


public class AutoComplete : System.Web.Services.WebService
{

    [WebMethod]

    public string[] getProducts(string prefixText)
    {

        DataSet dtst = new DataSet();
        string connStr = ConfigurationManager.ConnectionStrings["mySQLserver"].ConnectionString;
        MySqlConnection sqlCon = new MySqlConnection(connStr);

        string strSql = "SELECT name FROM products WHERE name LIKE '" + prefixText + "%' ";
        MySqlCommand sqlComd = new MySqlCommand(strSql, sqlCon);

        sqlCon.Open();
        MySqlDataAdapter sqlAdpt = new MySqlDataAdapter();
        sqlAdpt.SelectCommand = sqlComd;
        sqlAdpt.Fill(dtst);

        string[] cntName = new string[dtst.Tables[0].Rows.Count];
        int i = 0;

        try
        {
            foreach (DataRow rdr in dtst.Tables[0].Rows)
            {
                cntName.SetValue(rdr["name"].ToString(), i);
                i++;
            }
        }
        catch { }

        finally
        {
            sqlCon.Close();
        }

        return cntName;

    }

}

Some examples I've looked at include autocomplete="off" in the textbox control but it …

hericles 289 Master Poster Featured Poster

I take it you want the text to be over the image and larger. You can add the text to the image and still use roll overs if you want. Or you can use the background0image property of the div to have your text in a div and the image as its background.

Hope that helps,
Hericles

hericles 289 Master Poster Featured Poster

you seem to have a 50 element array and your loop is running from 0 to 49 (50 elements) but you're only selecting the top 49 in your SQL statement. Is the last iteration of the loop the problem? What point does it break at if you debug it?

hericles 289 Master Poster Featured Poster

hi,
You will be wanting to create a windows service instead of a standard windows application. You can't call an app and have it run like a service (maybe you can, but thats not what you need here).

there are many tutorials on the net. here's a simple one to start you off:
http://www.c-sharpcorner.com/uploadfile/mahesh/window_service11262005045007am/window_service.aspx

Hope that helps,

hericles 289 Master Poster Featured Poster

Hi,
It sounds like you need to use a Windows service. These run behind the scenes and have no windows or forms to display (usually). They can run at start up if needed. Is that what you are after?

hericles 289 Master Poster Featured Poster

Hi,
It sounds like you are on the right track. The session_start and session_end in the global.asax file can be used if there are any other tasks you want to achieve e.g. saving user data to a database (time on site, pages viewed, etc).

hericles 289 Master Poster Featured Poster

Hi,
If you add a Global.asax file to your website you can access methods for session_start and session_end. They are managed by the server, not the browser. For example the Session_start method is called the moment a new user requests a page from the site. The timeout period can be specified there and the server monitors the inactive or total time spent by the user on the server.
I hope that helps,

kvprajapati commented: Good explanation. +9
hericles 289 Master Poster Featured Poster

Hi,
You'll need to use session timeout for the idle feature. You can set that in the Global file.
For the log out feature you can use session variables. When the user logs in the logged_in variable is set to true, on log out you make it false. Then each page as it loads can check the status of logged_in and act accordingly. I'm assuming you've done something similar to this already otherwise a user could bypass the login screen by typing the url of the home page into the browser.
Hope that helps.