Cruize_Invades -4 Light Poster
rs.Open "select *from purchasetable", cn, adOpenKeyset, adLockOptimistic

    temp = 100
    temp2 = Val(rs!Remaining)
    rs.AddNew
    rs!Name = Label6.Caption
    rs!Quantity = Text1.Text
    rs!Total = Label5.Caption
    rs!MAXstock = 100
    rs!Remaining = temp - Val(Text1.Text)
   
    rs.Update
   
End Sub

you are subtracting temp(100) to the value of your text1.text
should it be temp2(your remaining items) minus the value in text1.text?

Cruize_Invades -4 Light Poster

what's the error?
or it just doesn't get what you want to produce?

Cruize_Invades -4 Light Poster

you forgot the enter :D
keyascii 13

Cruize_Invades -4 Light Poster
do
     {//menu
      cout<<"1. Input Price\n";
      cout<<"2. Input Cases Sold\n";
      cout<<"3. Display Report\n";
      cout<<"4. Quit\n";
      
      cin>>mans;
      } // missed this one
      while (mans <1 || mans > 4)
WaltP commented: Why can't you let him find it? It's his project. -4
Cruize_Invades -4 Light Poster

are your problems solved?

Cruize_Invades -4 Light Poster

'or try this one I just modify Jx_Man Code.

Private Sub cmdAddItem_Click()
Static count As Integer
Static name As String
count = lstPoints.ListCount
count = count + 1
name = "Point " & count
lstPoints.AddItem name

If count = 8 Then
    cmdAddItem.Enabled = False
End If
'when we add an item we set cmdRemoveItem to enable
cmdRemoveItem.Enabled =true
End Sub

Private Sub cmdRemoveItem_Click()
Size = lstPoints.ListCount - 1
lstPoints.RemoveItem Size

If lstPoints.ListCount = 0 Then
    cmdRemoveItem.Enabled = False
End If
'we enable cmdAddItem
cmdAddItem.Enabled = true
End Sub
Cruize_Invades -4 Light Poster

set pointer p to reference address of x
set pointer q reference address of y
-when we said address we are not actually refering the its value but the location in the memory, so when we

set pointer p value = 35,
set pointer q value = 98,

then set pointer p value to pointer q value (98)
when we print x, we are are getting the value 98 since the address of x (&x) value has been set to the pointer p value which is 98.

sorry for my english but i hope you get the point.

Cruize_Invades -4 Light Poster

Christos,

You still need to choose what language are you going to use, either C# or VB.Net.

Cruize_Invades -4 Light Poster

seems like you are removing the wrong session name. your session name in the web handler is tempSaleID and what you are trying to remove is SaleID

Cruize_Invades -4 Light Poster

You can schedule it. MS SQL has scheduling, so you can process your task here let say every 5 mins.

Cruize_Invades -4 Light Poster

If your database doesn't have cascade on delete,
you must first delete the records from the other tables related to the records you want to delete.

This is due the the relationships of table, if you have a primary key on the main table that you wanted to delete an specific record, but it is being used as a foreign key to other tables, then you must delete first the records in the other tables before you are able to delete the record on the main table.

Hope it helps.

Cruize_Invades -4 Light Poster

i need to validate in such a way when the user clicks button , if one of the textboxes are empty it should throw exception , now i know how to do this both in javascript and in serverside vb script , but what i dont understand is when the user clicks button will the javascript gets executed first or serverside vb code , because if the textboxes are null server side vb code should not get executed .

javascript is executed first. now when you determine that one of the textbox is empty.

if(document.getElementById('textboxt1').value == null ||document.getElementById('textboxt2').value == null || document.getElementById('textboxt3').value == null)
{
-- some logic --
return false;
}
else{
-- some logic --
return true;
}

return false would stop the execution of the severside code.

Cruize_Invades -4 Light Poster

you can clear the history. is that what you want?

Cruize_Invades -4 Light Poster

I did use Telerik before.

Is there any extra feature or advantage of using these that's not present in ASP controls ?

only few.

Cruize_Invades -4 Light Poster

are there any code behind that is need to be process?

anyway try this

$(document).ready(function() {
            $('#<%=Button1.ClientID %>').click(function(event) {
                alert("hello");
            });
        });
Cruize_Invades -4 Light Poster

hello Nithyamaha

as you can see

public static string GetRandomPassword(int length)
{

char[] chars = "$%#@!*abcdefghijklmnopqrstuvwxyz1234567890?;:ABCDEFGHIJKLMNOPQRSTUVWXYZ^&".ToCharArray();
string password = string.Empty;
Random random = new Random();
for (int i = 0; i < length; i++)
{
int x = random.Next(1, chars.Length);
if (!password.Contains(chars.GetValue(x).ToString()))
password += chars.GetValue(x);
else
i--;
}
return password;
}
}

requires one parameter, where in you call the method

GetRandomPassword();

without a parameter.

you should enter an integral value as a parameter to it.

GetRandomPassword(25);

so the password would be 25 characters in length.

Cruize_Invades -4 Light Poster

aside from ajax, which is very handy,
you can also try to use a webmethod

http://forums.asp.net/t/1528982.aspx

Cruize_Invades -4 Light Poster

as cocool stated, you are using an asp:button which by default calls a server events and do a postback.

if you want to call an javascript upon the click of asp:button, you might want to add a onclientclick event to the button to call a javascript then add

return false;

to it. this would cancel the post event of the button.

Cruize_Invades -4 Light Poster
Dim ssql As String = "UPDATE passwrd SET password ='" + TextBox1.Text + "'where username='" + TextBox2.Text + "'"

an error here is near the where clause. Try inserting a space between ' and where.

Cruize_Invades -4 Light Poster

ok I manage to Solve the problem. the problem was I am using a Form authentication and included my images.

Cruize_Invades -4 Light Poster

HI currently I am studying asp.net, how ever I manage to view my image just in my test.aspx page using this code

<img src="img/image.jpg" >

but when i use it on my login.aspx using the same code no image shows up.

can anyone help me about this?

Cruize_Invades -4 Light Poster

Now I see where my problem is. The SQL logins are having the format of Domain\users while the authentication I am using in my domain is using sAMAccountName that is using a different format.

hope you guys can enlighten me about this

1) Can I use Form Authentication using "DOMAIN\USER""?

thanks

Cruize_Invades -4 Light Poster

Guys please help me.

I am kinda new to ASP.net

Luckily I've manage log-in using forms authentication so that i could have a customize log-in page based on my Active Directory.
Now a Problem arise. I have to connect to my SQL EXPRESS database using the log-in I use. My SQL Express is using only windows authentication, and when I try to connect to SQL i get the error..

Cannot open database "DatabaseName" requested by the login. The login failed.

here is my web.config code

<configuration>

<connectionStrings>
  <add connectionString="LDAP://domain.com/DC=domain,DC=com" name="ADConnectionString" />
 </connectionStrings>
  <system.web>
<roleManager defaultProvider="AspNetWindowsTokenRoleProvider" />
<membership defaultProvider="MyADMembershipProvider">
  <providers>
    <add name="MyADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnectionString" enableSearchMethods="True" attributeMapUsername="sAMAccountName" />
  </providers>
 </membership>



    <!--membership provider entry goes here-->
    <authentication mode="Forms">
  		<forms name=".ADAuthCookie" timeout="10" />
	</authentication>

    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization>
        <identity impersonate="true" />
  </system.web>
</configuration>

hope you guys can help me

Regards

Cruize_Invades -4 Light Poster

Have u created the datasource(database driver)?
if not, then create it.

yes I have already created one.

Cruize_Invades -4 Light Poster

my connection string goes like this...

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDB;Data Source=mysource

I am using windows authentication, iis 7 and Classic ASP to to connect to SQL express 2008.
Using UDL i can connect to my SQL.
I can also connect to my SQLExpress when i am running my Database management studio.

my problem is that i cannot connect to my datasource and response "Cannot open database "mysource" requested by the login. The login failed." upon connecting via asp pages.

I have tried setting my IIS7 to use windows authentication but the problem is that i don't want to go trhough the usual login page that prompts and created my own login pages that is connected to my AD.

Can anyone help me?

Regards.

Cruize_Invades -4 Light Poster

Hi guys i have just installed windows 7 on ma pc but failed too configer the IIS "internet information service" in order to enable me run ma asp pages. is iis installed already or not?

i believe it is not yet installed. but you can install it.
follow this link. hope it may help you
Click here

Cruize_Invades -4 Light Poster

Hello!

I am currently doing some authentication in Active Directory.
Our AD is running in Windows 2008 Server and I manage to log-in based in our AD. However I also want to get the group where the user belongs. but I don't know how. Can anyone help me?

here is the authentication in AD I copied...

<%@ Language="VBScript" %>
<% 

Option Explicit
Response.Buffer = True  

'// 1. Form Validation
Dim Submit, UserName, Password, Domain, Result, Message
Submit = "Authenticate"

'Assume Failure
Application("Error")= true 

If Submit = "Authenticate" Then
     response.write("autenthication <br>")
    'Get the input from your HTML form
    UserName = Request.Form("UserName")
    Password = Request.Form("Password")
    Domain = Application("Domain")
  
  Session("usern") = UserName
    'Call the AuthenticateUser() function to do the verification process
    Result = AuthenticateUser(UserName, Password, Domain)

    If Result Then
        'If user exist, then redirect to success page
 	'login success
	Application("Error")= false
        Response.Redirect ("success.asp")
    Else
        'If user don't exist, redirect to error page
	'login failed
	Application("Error")= true 
        Response.Redirect ("../")
    End If
End If

'// 2. Authenticate Function
Function AuthenticateUser(UserName, Password, Domain)
    Dim strUser, strPassword, strQuery, oConn, cmd, oRS

    'Assume Failure
    AuthenticateUser = false

    strQuery = "SELECT cn FROM 'LDAP://" & Domain & "' WHERE objectClass='*'"
    Set oConn = server.CreateObject("ADODB.Connection")
        oConn.Provider = "ADsDSOOBJECT"
        oConn.Properties("User ID") = UserName
        oConn.Properties("Password") = Password
	oConn.Properties("Groups") = "SALES"
        oConn.Properties("Encrypt Password") = true
        oConn.open "ADProvider", strUser, strPassword
    Set cmd = server.CreateObject("ADODB.Command")
    Set cmd.ActiveConnection = oConn
    cmd.CommandText = strQuery
    
    On Error Resume Next
    Set oRS = cmd.Execute

    If oRS.bof OR oRS.eof Then
        AuthenticateUser = False
    Else
        AuthenticateUser = True …
Cruize_Invades -4 Light Poster

Please check the data type of the fields 'Barcode' in both table, the Personal and the Store_Barcode. The data type of the two must be the same, example the Barcode in Personal is in Integer data type and the other is in "Text/Char" data type, then it would really return an Error.

Cruize_Invades -4 Light Poster

The application would actually run, but as they said, it cannot access the database and probaby get an error... But if you are trying to access the SQL on using a client.. you should first establish a connection between the CLIENT and the unit where the SQL is installed... then the application would work..

hope it helps.

Cruize_Invades -4 Light Poster

I'm so sorry I don't have a vb installed on my pc. I just reformated it.. try using this one as a partial code.

ID= left$(str,5)
str= mid(str,5)

hope it help.

though the problem here is that you the str is being crop continuously... try solving it.. you can do it..

this is if you dont have any delimeter, just wanted to seperated strings.

Cruize_Invades -4 Light Poster

if you want to know the length of a string just simply use the len(string) that would return the length of the string..
just the string..

string is the variable you want to get the length.

Cruize_Invades -4 Light Poster

uhm,, maybe in the doshow code, I don't know your doshow code.. but as QVeen72 said, have you tried her code??

Cruize_Invades -4 Light Poster

If I can still remember...

Goto Add Components and add the Shockwave Flash...
if you can't see the Shockwave flash component click browse and then go to the folder where the Flash is installed and then search for its .ocx...

then to have a movie playing..
well do it for your self... I know you can do it.. Just the movie property...

Cruize_Invades -4 Light Poster

I don't know what code you have but here is a trick..
in order to have different random number all you have to do is to put the code Randomize in the main form where the random number is generated. But the problems may occurs here, it is not a major but rather a logical problem.

anyway just put the Randomize code in the form..

Cruize_Invades -4 Light Poster

if anybody knows how to apply searching in VB6.0 ,please let me know.

exactly what dbase are you going to use and what kind of searching do you wanT???

Cruize_Invades -4 Light Poster

I'm really sorry for the trouble.. I misused the syntax for I have a project on C++ in creating a game. Sorry for the trouble.. and thanks for reminding me. I GOT LOST.... THIS IS VB..

int the first error, there is simple a semicolon in the end of the code... you see.. that shoudn't be there...

about the second mistake I have... I am wondering, wouldn't there should be y=x+1 before the if statement... since that if you're going to compare the first element and the next...

Cruize_Invades -4 Light Poster

I got confused, well this is my understanding, correct me if I am wrong,

there should be an indicator to tell if the array is sorted in ascending.. and if not the sorting should continue after each passes...

dim check as integer
check = -1
 
while check=-1
    For x = 1 To UBound(Sarray) - 1
        y = x + 1;
        If Sarray(x) >= Sarray(y) Then
            doSwap x, y
        End If
    Next 
'end of the pass
'this would check the array each passes
    for x = 1 to UBound(Sarray) -1
        if sarray(x) > sarray(x+1)
            check=-1
            exit for
        else
            check=0
        end if
    next
wend

I'd like to explain this how, but try it and you'll understand...

Hope this answers your question... sorry for the late post,, I got busy this past few days.. and by the way, I think you can still minimize my code.

Cruize_Invades -4 Light Poster
For x = 1 To UBound(Sarray) - 1
        For y = (x + 1) To UBound(Sarray)
            If Sarray(x) >= Sarray(y) Then
                doSwap x, y
            Else
                 Exit For
         Next y
Next x
            End If
         Next y
Next x

I think that there is really a compiler error here.. you see your ebd if,, it is in a wrong place...

try replacing your code above with this one...
hope it helps

For x = 1 To UBound(Sarray) - 1
        For y = (x + 1) To UBound(Sarray) 
              If Sarray(x) >= Sarray(y) Then
                   doSwap x, y
              End If
        Next
Next

note that I don't use any else statement since if you want to increment just the second ( variable y) as variable x remains in its position then all you have to do is to increment 'y' and after the last element in the array is being compared then that's the only time the variable y increment..


Regards

Cruize²

Cruize_Invades -4 Light Poster

To the both of you, I really appreciate it.. Thanks to the both of you and happy programmming....

Ahihihi

Cruize_Invades -4 Light Poster

I heard that using VB 6.0 I can disable the start button. But I've search to found what code to be put but unfortunately i cannot found one. I also know that code for win98 differ from XP OS... So pls some one teach me... Thanks a lot..