rapture 134 Posting Whiz in Training

Seems to me, and it's been a few years, that I got something very similar in school and I was supposed to finish the code. Are you just posting what you got and hoping we will write the part you're supposed to finish?

rapture 134 Posting Whiz in Training

Then mark as solved

rapture 134 Posting Whiz in Training
the code
rapture 134 Posting Whiz in Training

We know the code but are not going to just give it to you, it's in your best interest. And if you've got a degree that dealt with any type of programming you should be adept at searching for solutions and working through problems. You might start over and write out pseudocode of what you want the program to do first. We can help you make sure you're on the right track there. After that then you can start with the smallest part and work into the problem instead of tackling the entire thing in one shot. It's not hard and shouldn't take long but a good tactic in any situation where you have to solve problems is to start with what you can figure out and work up from there.

rapture 134 Posting Whiz in Training

You only need probably three variables, try to read a variable and then process it. you would grab the first number and insert it as the value of the smallest and largest variables. Then grab the next number and compare it against a smallest and a largest variable and replace that variable with the read variable if it's smaller or larger. Loop through it until you've read five numbers and you will have found your largest and smallest.

Technically your start would work, but you would have to repeat it for every variable, then repeat it the same number of times for less than stopping when you found them both.

However that is very inefficient and nobody would do it and I think your professor wouldn't give you a very good grade anyway.

P.S. - an array works but if you can't handle this without an array I figured you're way out of reach of being able to use an array

rapture 134 Posting Whiz in Training

some great tutorials here, including on using data access layers

http://www.asp.net/learn/data-access/

rapture 134 Posting Whiz in Training

So did you try it? Get it solved?

rapture 134 Posting Whiz in Training

Looks to me like his option is the one recommended by Microsoft...

http://msdn.microsoft.com/en-us/library/aa713398%28VS.71%29.aspx

rapture 134 Posting Whiz in Training

I couldn't find much from google using "read .pst from vb.net" which is probably similar to what you were searching for. When I switched the search to "coding for outlook with vb.net" I got some results that probably will help you.
Try the google search, this link was found there and may be of assistance:

http://www.codeproject.com/KB/aspnet/extract_oulook_2003_NET.aspx

although I'm not sure what you were trying to do or what you had tried

rapture 134 Posting Whiz in Training

Thanks for the help guys!

rapture 134 Posting Whiz in Training

I think I may have worded my question in an incomplete manner, I apologize.

What I wanted to know is if I can use expression web to build a nice front end and integrate it with VS2008 for the back end work. I'm not trying to build the database interaction with it, I'm trying to figure out an easier and cleaner way to develop the front end of the sites. I wondered if I could do that with expression web and then integrate it with a VS2008 project.....

And thanks for your help

rapture 134 Posting Whiz in Training

Interesting, the expression web site states that you can

"If you think and breathe code, Expression Web has you covered there too with flexible support for a wide range of essential technologies: PHP, HTML/XHTML, XML/XSLT, CSS, JavaScript, ASP.NET and ASP.NET AJAX, Silverlight, Flash, Photoshop files, and video/audio for webcasting. "

I'm having difficulties with front end design in VS2008. It's just not as flexible as I would prefer, I was hoping that expression web would offer a little more in that area..

rapture 134 Posting Whiz in Training

cool, if it's fixed mark it as solved for others who search

rapture 134 Posting Whiz in Training

Does anyone have any suggestions/tips/ideas on the merits of Expression Web? I'm using Visual Studio 2008 but the front end work seems to be lacking. I don't know much about expression web and wondered if anyone used it and if it's worth the money.

rapture 134 Posting Whiz in Training

Unless you're required to code it yourself, there is a very good tutorial and explanation on how to use the built in features for login here:

http://download.microsoft.com/download/3/6/0/3604c3d2-0db9-4726-910d-b3b8f93a86e4/hilo_membership-roles_final.wmv

kvprajapati commented: Good suggestion. +7
rapture 134 Posting Whiz in Training

Have you done a search? Looks like a good explanation here

http://www.vbdotnetheaven.com/Uploadfile/mgold/WordDocument04182005081441AM/WordDocument.aspx

will that work for you?

(You also might want to post future VB.Net questions in the VB.Net forum)

rapture 134 Posting Whiz in Training

First of all what is your question? What do you need help with? Are you asking us to write the program for you?

If you've started then post your code and what you're having trouble with, if you have not started then find the smallest piece of it you can do and start there.

rapture 134 Posting Whiz in Training

Alright, I'll try to help you if you're trying to help yourself. Post me some code and let me know what you're trying and what you think isn't working. I won't just do it for you, but maybe we can work through it together.

rapture 134 Posting Whiz in Training

I'm fairly new to asp.net and trying to use a session counter to check for when someone has tried to log in three times it counts and when reaches three it locks them out. I know it's easy but my brain is fried.

Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click

        Dim IsFound As Boolean = False


        If Page.IsPostBack Then

            IsFound = clsDataLayer.GetUser(Server.MapPath("AddressBook.mdb"), txtUSERID.Text, txtPassword.Text)

            If (IsFound) Then

                'user credentials were found in the database so notify the system that the user is authenticated

                lblStatus.Text = "Welcome"

                'if authentic then wait three seconds to display the welcome label then send user to mymobilepage

                Response.AddHeader("REFRESH", "3;URL=mymobilepage.aspx")

            Else  'invalid user credentials

                Dim myAttempts As Integer = Convert.ToInt16(Session("AttemptsCount "))

                myAttempts = myAttempts + 1

                Session("AttemptCount") = myAttempts 'update the session variable with the new value

                lblStatus.Text = "The User ID and/or Password supplied is incorrect. Please try again!"

                If myAttempts >= 3 Then

                    Dim myDAL As New clsDataLayer

                    myDAL.Lockuser(Server.MapPath("Addressbook.mdb"), txtUSERID.Text, False)

                    lblStatus.Text = "Your account has been locked and will need to be reset by the system  administrator!"

                End If

            End If

        End If

Can someone direct me the proper way?

rapture 134 Posting Whiz in Training

Another problem in my program is that I can't get my access database to update. It works on the other fields here is the code

Public Sub Lockuser(ByVal path As String, ByVal userId As String, ByVal access As Boolean)


        Dim sqlConn As OleDbConnection

        Dim oCommand As OleDbCommand

        Dim stmt As String

        Dim param As OleDbParameter

        ' This sets up the connection to the database including the path passed in

        sqlConn = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & path & "")

        sqlConn.Open()

        oCommand = New OleDbCommand()

        oCommand.Connection = sqlConn


        stmt = "UPDATE tblUsers SET Access = @access" & " WHERE(tblUsers.UserID = @userId)"

        'declare parameter objects for the command object

        param = New OleDbParameter()

        param.ParameterName = "@userId"

        param.Value = userId

        oCommand.Parameters.Add(param)

        param = New OleDbParameter()

        param.ParameterName = "@access"

        param.Value = False

        oCommand.Parameters.Add(param)

        oCommand.CommandText = stmt

        oCommand.CommandType = CommandType.Text

        oCommand.ExecuteNonQuery()

        sqlConn.Close()

    End Sub

I've tried a yes/no and text field but it won't update in access. Am I missing a step?

rapture 134 Posting Whiz in Training

Thanks,

I assume that you were in the middle of posting this when I typed my last statement?

I already have a login and registration system in place, I don't need free we're using SQL Server 2005 and a custom system built in-house. My problem turns up with the amount of different combinations, thus I can't build individual pages. I know I can use google analytics and may go that route to help with the frequently used items but wondered if there was a better way.

I can't do a limited number of categories and that's my biggest hurdle at this point. I can make it work with hard code that is similar to what Tommy posted, but as the number grows it doesn't seem like a good method. It appears I'm going to have to build a user interface for the business side and allow them to select what they want displayed and pull the information that way. I had hoped to just use criteria in our current profile but it needs a complete overhaul to do what I want.

Anyway - thanks for the ideas

rapture 134 Posting Whiz in Training

I appreciate the help, I had considered that as well but my problem is that with what I want to do it was going to require over 100 different cases or nested if's - basically what I wanted to do was have only the products available to the person show up on their page - but we have so many combinations that it looks like a horrible way to code and even worse way to maintain. I thought if I could dynamically pull the combinations and fill certain criteria based on what was selected for them or their id then I wouldn't have to go that route.

For the second portion I want to pull all the rates available but only display certain parts based on their desires and filter criteria that they can change and hope to avoid page reloads out the yang. It's going to require a bit of reading and I'll keep up with Ajax and see where it leads me, it does appear it will do what I want so I'll mark this as solved.

Thanks again

rapture 134 Posting Whiz in Training

Thanks for the post,

You see, I can code it in C# server side - but it will require a very large amount of pages for what I want to do. It's not practical. (yes I know I didn't describe exactly what I want to do where this would be evident)

I posted it in the Ajax thread because that's what I believe that I need to use to do what I want to with it, however they told me Ajax wasn't the best way that PHP was, so I posted it up here. Then get warned by a moderator because it's in multiple threads and now you're telling me to go back to Ajax.

It's sort of funny in a way, I had hoped for someone to just give me an idea of where to look but apparently nobody has a clue how to do what I want to do so I'll give up.

I think you're onto something with Ajax, I got a little of it to work and think I can use it but it's going to take some additional study to be sure.

rapture 134 Posting Whiz in Training

I've got a pretty good understanding of databases, I use them all the time. I also use C# on a regular basis and the bulk of the backend will be in C#.net with a ton of datbase interaction. I work as a programmer, thus I'm not a complete newb. :) I'm just trying to shorten the learning cycle by finding the technology that will help me accomplish what I want to do first. No reason to spend a month on JavaScript if I need PHP..... make sense?

I'll grab a few things on PHP since you seem confident that I can do what I need to with it, would you have any suggestions about what specific areas I'll look into once I start looking?

Thanks

rapture 134 Posting Whiz in Training

Hello all,

It seems I'm on a wild goose chase, either that or this is going to be a lot harder than I imagined, and I imagined it being pretty difficult.

I posted in other forums here asking for help on this issue, it was suggested that PHP may make this job easier. I've no experience with PHP but am willing to learn it if it will in fact help us complete the needed tasks. Here is my previous post, any comments or suggestions would be greatly appreciated:

I'm a bit newer and looking for some direction. We would like to create a new website and have that do some dynamic things based on login id. First all we would like to send you do a different home page based on this information, it might be one of several companies. This may also be tied to what URL you clicked but not necessarily. The second thing we would like to do is display only the products that you are eligible for based on your login information. We would like to use images as a link here and if you can sell one product you get one image or maybe bypass and go directly to that section, but if you can sell two or more then those images as links show up as available. The final thing we want to do is to populate the top 3 or so items you perform on the site as quick links.

rapture 134 Posting Whiz in Training

essential,

Thanks for the tip, I've not done any PHP in the past but if it will help speed things up I'm all for learning it!

I'll start looking into the possibilities with this. Maybe the PHP guys have some suggestions . . .

Thanks again,

rapture 134 Posting Whiz in Training

Hello all,

I've submitted something similar in the asp.net forum so if you frequent both you'll see it in both places.

I'm curious if javascript or ajax can help us accomplish some of our tasks, here is the post in the other thread:

Hello all,

I'm a bit newer and looking for some direction. We would like to create a new website and have that do some dynamic things based on login id. First all we would like to send you do a different home page based on this information, it might be one of several companies. This may also be tied to what URL you clicked but not necessarily. The second thing we would like to do is display only the products that you are eligible for based on your login information. We would like to use images as a link here and if you can sell one product you get one image or maybe bypass and go directly to that section, but if you can sell two or more then those images as links show up as available. The final thing we want to do is to populate the top 3 or so items you perform on the site as quick links.

After all that, are there tools or items I should study to help us accomplish this task? I'm not sure if I need to mix in some sort of third party analytical tool with the asp.net site …

rapture 134 Posting Whiz in Training

If you really want help here, read about the forums.
One suggestion:

Start by NOT posting to threads that are four years old and someone elses thread to boot while asking for advice

rapture 134 Posting Whiz in Training

Wow, I had to do this one in school too!

Get as much down on code as you can and we can help you step through were you're stuck

rapture 134 Posting Whiz in Training

Oh, I had to do this one too!

I suggest you start by putting everything you can down in code and then when/if you get stuck the post what you have and we can help you through it. The toughest part is getting yourself started.

rapture 134 Posting Whiz in Training

Thanks, that helps - we don't have any inserts that will be affected that I can think of so it's not a huge deal. I think what I was thinking was he just wanted to get the last record regardless of the reason and if someone else entered a record he might not get the right id returned. But based on his question I think your way gets him the last id that this user entered so that's the way to go.

*but hey man I always though reading dirty data was a good thing . .. jk :)

rapture 134 Posting Whiz in Training

Can you find an example? on MSDN here http://msdn.microsoft.com/en-us/library/aa933217(SQL.80).aspx

it looks like it is similar to @@IDENTITY AND SCOPE_IDENTITY but just returning the last id value from any session or scope.

I see a problem if the table is null
http://support.microsoft.com/kb/835188

but if the table is created why wouldn't this be the best way to go?

--and thanks for the advice :P

rapture 134 Posting Whiz in Training

Intersting, thank you - and what was your take on using

SELECT IDENT_CURRENT(’tablename’)

rapture 134 Posting Whiz in Training

If you want to get technical, you're advice is bad as well, as scope_identity will:

"SCOPE_IDENTITY(), like @@IDENTITY, will return the last identity value created in the current session, but it will also limit it to your current scope as well. In other words, it will return the last identity value that you explicitly created, rather than any identity that was created by a trigger or a user defined function."

Thus it may not return the proper id that the user entered right?

my solution was just a quick fix for a small database and someone new, it will work in most instances but the proper method would technically be

SELECT IDENT_CURRENT(’tablename’)

as this will return the last identity in the table regardless of the other variables mentioned. I suppose I should have answered this way the first time to prevent disagreement and confusion of the original poster or those who search the subject. Thanks for the advice.


Also of note, there is a possible bug when run in parallel with scope_identity as well that get more complicated
http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/

Darab,

You can use either method mentioned. If you're just working on a small project then scope_identity may work fine. Otherwise you can use SELECT IDENT_CURRENT(’tablename’) as stated. This should answer your question. Go ahead and ask anything else you need on this subject or mark the thread as solved. :)

rapture 134 Posting Whiz in Training

To get the last record in a SQL database you simply type

SELECT TOP 1 * FROM tableName ORDER BY columnWithYourID DESC

or if you just need the id then


SELECT TOP 1 (columnWithYourID ) FROM tableName ORDER BY columnWithYourID DESC

This will return the last record in the column you want from the table you are looking for. How to translate that into C# without using SQL I do not know.

sknake commented: no. That is unsafe as it creates a race condition. -1
rapture 134 Posting Whiz in Training

You don't say if you have any programming experience at all. So the answer could be different. I think the O'Reilly books have a lot of good information in them but there is a lot of stuff on the web you can also refer to, C# Tutorials are all over the place. You can also search daniweb there is a ton out there already on this subject

http://www.daniweb.com/forums/thread154334.html

http://www.daniweb.com/forums/thread3325.html

http://www.daniweb.com/forums/thread36030.html

rapture 134 Posting Whiz in Training

Please don't post to threads this old . . .

Thanks!

rapture 134 Posting Whiz in Training

Did you realize this was a 9 month old post?

rapture 134 Posting Whiz in Training

1) You're posting to a thread that is two months old, start you own thread.
2) You have not explained your problem nor have you shown what you've done to reach the point where you got an error. (if all you did was copy and paste someone else's code you're not going to get help.)

rapture 134 Posting Whiz in Training

Hello All,

I'm wondering if anyone can help me by either directing me towards a source that would help me understand Access syntax better or help me figure out if it's possible to convert this SQL syntax to Access. I've tried but can't seem to get it to work.

my SQL is

SELECT  
	substring(c.[DealerNumber],11,3) AS InsGrp, 
	substring(c.[DealerNumber],1,2) AS DlrSt, 
	c.DealerNumber, 
	c.ContractNumber, 
	substring(c.[DealerNumber],13,1) AS Expr1,
	c.ownerfname,
	c.ownerlname,
	c.address1,
	c.address2,
	c.city,
	c.state,
	c.zip,
	c.carrierid,
	carrier.carriername,
	dbo.InsuranceGroup.TPA,
	dbo.CLAIMS.ClaimNumber,		
	dbo.CLAIMSCOMP.Status,
	dbo.claims.date,	
	dbo.CLAIMS.CorrectiveAction

FROM 
	contract C
INNER JOIN 
	carrier 
ON 
	c.carrierid = carrier.carrierid
INNER JOIN 
	dbo.InsuranceGroup 
ON 
	substring(c.[DealerNumber],11,3) = dbo.InsuranceGroup.InsuranceGroup
INNER JOIN
	dbo.claims
ON
	dbo.claims.contractnumber = c.ContractNumber
INNER JOIN
	dbo.claimscomp
ON
	claims.claimnumber = claimscomp.claimnumber

WHERE 
	(((substring(c.[DealerNumber],1,2))= 'CA') 
AND 
	((substring(c.[DealerNumber],13,1))='M')) 
OR 
	(((substring(c.[DealerNumber],1,2))='IA') 
AND 
	((substring(c.[DealerNumber],13,1))<>'M'))
AND
	(((dbo.InsuranceGroup.TPA) In ('Dimension','NASC','NASC Old')))
AND 
	(((dbo.CLAIMSCOMP.Status) In ('07','93','94','de','du','dn')))
AND
	dbo.claims.[Date] > '2009-03-11 13:40:38.000'

and I seem to get errors when trying to put this into Access. I've tried the GUI but the join on substring I can't figure out. This query works fine in SQL, however, I'm trying to get it into an Access query so a user can run the report whenever they want without having to come to IT.
Thanks

rapture 134 Posting Whiz in Training

start quote:

// Declaration=1000
 const int Last_Number = 1000;
//Declaration=0
 int Primes = 0;
//Creating an array and set it = to an new array Last number and make it true
Array Numbers = new Array(Last_Number, true);
//for loop declare i=2,if i<last_number in array add i to i
for (int i = 2; i < Last_Number; i++)
{
// Substitute i into the array
if ( Numbers[i])
{
//for loop declare j=2,if j<last_number in array add 1 to j
for (int j = i * 2; j < Last_Number; j += i)
//Substitute i into the array and make it false
{ Numbers[j] = false; }
}
}
//for loop declare i=1,if i<last_number in array add i to i
for (int i = 1; i < Last_Number; i++)
{
if ( Numbers[i])
{
//add primes
Primes++;
//write values of i
Console.Out.WriteLine (i);
}
}
//new line, write the prime numbers, prime numbers found in the range 2 - 1000
Console.Out.WriteLine (i);
( "\n" + Primes + " Primes found in the range 2-" + Last_Number );

end quote.

so much is either wrong with this code, or I am too new to understand. For instance, the array declaration is unlike anything I've ever used. It tries to take Last_Number and make it a const int with a value of 1000 then try to use the same variable name in an array declaration. Then without declaring 'Numbers' it tries to assign a value of the …

rapture 134 Posting Whiz in Training

I'm willing to help you with this under a couple of conditions (I reserve the right to add more later)

#1 - Please tell me where you got the code and why you want to know. Don't lie, if it sounds as though you are I'm out.

#2 - I want you to put your comments before each line, and I want you to tell me what you think it is doing. I do NOT want anything similar to "I have no idea" - give me your best guess if you can't come up with a rough idea.

rapture 134 Posting Whiz in Training

Hmm, thanks for posting your solution. That should help

would you mind marking it as solved so others can find the answer?

rapture 134 Posting Whiz in Training

looks like it, although I have not done this myself - type"

"VB.NET WinForms - DataGridView - Adding new rows, removing old ones to AcceptChanges"

in google and it's the first entry, you can then scroll down to the bottom and see the accepted solution. (it's a long scroll down)

for some reason the accepted solution is blocked when you post the link somewhere

rapture 134 Posting Whiz in Training

Did you have further questions? It seems as though sknake answered the question quite completely but you didn't mark the thread as solved. If you just mean add variables he put it right out there, what were you adding specifically?

rapture 134 Posting Whiz in Training

I see you've posted this on the vbforums website as well. I don't post over there but it doesn't look like you've gotten your answer yet either. I have two possible suggestions for you

One is to reset the row numbers with something like this

For i = 0 To newRow.ItemArray.Length - 1
      currentRow(i) = newRow(i)
      Next

( I found that on experts-exchange - if you scroll to the bottom the solutions are there but he was having a different problem than you)

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Studio_.NET_2005/Q_22924060.html

The other suggestion is to look at .acceptchanges

possibly http://msdn.microsoft.com/en-us/library/system.data.dataset.acceptchanges.aspx and reset the database

rapture 134 Posting Whiz in Training
rapture 134 Posting Whiz in Training
rapture 134 Posting Whiz in Training

I guess my replies are either completely wrong or not worth looking at - seems to me on that link I posted was this

//Create a connection to the SQL Server; modify the connection string for your environment
			//SqlConnection MyConnection = new SqlConnection("server=(local);database=pubs;Trusted_Connection=yes");
			SqlConnection MyConnection = new SqlConnection("server=(local);database=pubs;UID=myUser;PWD=myPassword;");

			// Create a Command object, and then set the connection.
			// The following SQL statements check whether a GetAuthorsByLastName  
			// stored procedure already exists.
			SqlCommand MyCommand = new SqlCommand("select * from sysobjects where id = object_id(N'GetAuthorsByLastName')" +
			"  and OBJECTPROPERTY(id, N'IsProcedure') = 1", MyConnection);

			// Set the command type that you will run.
			MyCommand.CommandType = CommandType.Text;

			// Open the connection.
			MyCommand.Connection.Open();

			// Run the SQL statement, and then get the returned rows to the DataReader.
			SqlDataReader MyDataReader = MyCommand.ExecuteReader();

maybe you have some of this stuff other places, like the connection etc.

If I'm way off, please ignore me as I'm still fairly new.

Did you step through it to see what happens?

rapture 134 Posting Whiz in Training

There and you can check here
http://support.microsoft.com/kb/320916