Hello All;
I usually do everything in SQL Server these days, however, I have an site that is just so small, that it is going to be using an Access database.
This is the code that I am using to generate the Google Sitemap with, however, there is code here that does not translate over to ACCESS Database.

SELECT imageid, imagetitle, MedUpdate as DefaultTime, convert(varchar(11),MedUpdate,121) as UModDate, CONVERT(CHAR(8), CONVERT(DATETIME, MedUpdate, 113), 114) AS UMilTime, convert(varchar(11),MedDate,121) as JDate, CONVERT(CHAR(8), CONVERT(DATETIME, MedDate, 113), 114) AS JTime FROM Images GROUP BY imageid, MedUpdate, MedDate, imagetitle order by imageid

Could someone please convert this over to a working ACCESS Query please?
Thanks.
Carrzkiss

There is no-one responding, because this thread if really old.
And the last person posted a million lines of code, and most people will not touch it.

View this article and see if it will assist anyone that may come across this issue.
http://kb.cffcs.com/Main.asp?irid=1&Type=Article

Google Chrome is a A** of a program, it was causing all the problems.
IE8 found the problem when Chrome would not.
I am going to have to test FF to see if it is going to act like Chrome or not.

I logged into the site on Chrome, and was able to navigate, but COULD NOT upload images.
It was not finding me as being logged in.
BUT!!! (This is the A** part)
I went over the IE8 and logged into the site, and wa-la
The dag-on thing worked in both IE and Chrome.

So, my script was right the entire time, and for the last 3 days I was chasing a ghost.
So, what is the deal with Google Chrome?
Does it not read cookies properly when they are sent to it or do you have to be logged into IE or what?

Any incite on the google chrome crap please let me know.

Time to complete the development of my site, I am happy now :)

Carrzkiss

The cookie expires in 30 days.
It has about 25 days left on the cookie.
So it is not an Expire issue, as I can read the cookie in an
AJAX example, as well as to the main page.
Just cannot get it to work/read on the JQuery (Uploadify) ASHX Page.

If I cannot get this to work, then I will just see about passing a variable through the JQuery code to the page and see if that will work??

Any others idea's?

I tested the code in another site and it works as long as the page is visible.
Since this is running on a JQuery it does not seem to want to work?

Any idea's would be great on this issue.

[B]Carrzkiss[/B]

Hello All;

It seems that I have just run into a small issue that I am hoping can get resolved pretty quickly, as it is the only thing that is holding me back from completely this part of my task.

In an ASHX file, I am needing to read a cookie to pass its value to a SQL Select statement to pass another value from their to a SQL Insert.

This is what I am using and it breaks everytime.
And since I am using FLASH, it is hard to find out "why" i am getting the error as I cannot view the error code(s).

This is the code
[CODE]Dim strmegaun As String = context.Request.Cookies("cffmega")("user")[/CODE]

I am passing it to my select statement as:
[CODE]getUser.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Username", strmegaun))
[/CODE]

And it is not working.
I removed the cookie reference and put in the actual value to make sure it got the value and it does, it passes the values to the INSERT statement and everything works fune, until I do the cookie reference. so I know that it is the Cookie
That is causing this issue.

Thank You
[B]Carrzkiss[/B]

Can someone please tell me why this is not working?

Got it working.
Had to change
[CODE]
username=?
to
username=@username
[/CODE]
And that did it.
THANK YOU!!!

Works great.
This is done and I am happy, I can not start the development process of the site. (Which will be done in ASP Classic)
By this weekend the site will go live, thanks to your 1-time post and code.
Thank You: [B]Oxiegen[/B]

[B]Carrzkiss[/B]

I am just learning asp.net myself. This is only my 2nd week in it.

What I usually do is make up demo's for people to learn by.
Please download this example and run it.
This comes with an Access Database and the code you need to run the project.

[url]http://www.cffcs.com/Tutorials/ASPNETCsharpUwT&DI.zip[/url]

Please study the code and then implement the SQL Server code inplace of the Access Database code.
And I am sure you will be pleased.

Please let me know if you have any issues.

Good Luck
[B]Carrzkiss[/B]

Hold it.
Incorrect syntax near ?

This error means that there is no value being passed and the the string is empty.

I will have to do some checking on this one.
I will get back to you later on today, other than that, I replaced the
? with a username in the db and it compiled through, so I am happy.
I just need to get the cookie to read through to the string.

Any idea's on the code that I am using? It seems to be done right, as it does grab the contents of the cookie and display it to the page.

[B]Carrzkiss[/B]

Thank you so very much for your reply.
I am getting the following error.

System.Data.SqlClient.SqlException: Incorrect syntax near '?'.

And the line is:

[CODE]resultsReader = getUser.ExecuteReader(CommandBehavior.CloseConnection)[/CODE]

But the Error I think is pointing to:

[CODE]Dim getUser As New System.Data.SqlClient.SqlCommand("select Username from MegaUsers where username=?", cn)[/CODE]

It looks ok to me, but then again, nothing has really looked good since I started this project.

Any idea's?
Thank you once again, it is going to be so nice to actually be able to show something once this runs error-free.

Hello All;
I would like to start off by saying hello, and that this is actually my first post to the group, even though I have been a member for many years.

I am a ASP Classic Programmer, professionally for a little over a year, I have developed some rather nice sites, including the one in my signature (Still a work in progress).

I have been forced to use ASP.NET (VB) for a FileUpload control, as it offers a self controlled way of creating Thumbnails, without the use of 3rd party controls, which is great, as my hosting server does not allow for 3rd party installs on their servers.
So.

The code below is what I have so far for connecting to the database and displaying a record is the "cookie" exist on the users computer.
Unfortunantly, this is not working, and to be honest with you, their is not a whole lot of resources available to show how to do this correctly.
So I am stuck with a lot of post and hoping that someone can actually assist me with this and tell me what I am doing wrong and maybe correct my code.

I am getting an error about the "Connection is closed"
So, I am at a complete loss, I have asked this question on other forums and to no avail, and it like no one knows what to tell me.
They try to give me things to try, but absolutely nothing has worked so far.

So. ...

This is something that I use, and it works quite well.

Throw a FileUpload control on your form, and add in in the code behind.
This should work stright out of the box.
I just copied and pasted it in, if you have any issues please let me know.

[B]Carrzkiss[/B]
[code]
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Drawing.Imaging
Imports System.Drawing
Imports System.Drawing.Drawing2D
protected void UploadButton_Click(object sender, EventArgs e)
{
if (FileUploadControl.HasFile)
{
try
{
if (FileUploadControl.PostedFile.ContentType.Contains("image"))
{
if (FileUploadControl.PostedFile.ContentLength < 102400)
{
string filename = Path.GetFileName(FileUploadControl.FileName);
FileUploadControl.SaveAs(Server.MapPath("~/Uploads/") + filename);
StatusLabel.Text = "Upload status: Original File uploaded! proceeding to produce thumb nail
";
System.Drawing.Image ImageToSave = resizeImage(System.Drawing.Image.FromStream(FileUploadControl.FileContent), new Size(130, 150));// supply actual image to the function
ImageToSave.Save(Server.MapPath(System.IO.Path.Combine("~/Uploads/", filename.Insert(filename.LastIndexOf('.'),"-T"))));// the function returns a thumbnail which is saved here
StatusLabel.Text += "Upload status: Thumbnail produced...";

    Dim objConnection As OleDbConnection = Nothing
    Dim objCmd As OleDbCommand = Nothing
    Dim strConnection As [String], strSQL As [String]

       
strConnection = "Provider=SQLOLEDB;Data Source=MACHINE-NAME;Database=DATABASENAME;User ID=USERNAME;Password=****;"
       
objConnection = New OleDbConnection(strConnection)
objConnection.ConnectionString = strConnection
        // change this to work for you.
objConnection.Open()
strSQL = "INSERT INTO MegaPics(PicsPath, PicsSize)VALUES(?,?)"
objCmd = New OleDbCommand(strSQL, objConnection)
objCmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@PicsPath", getYear + clear))
objCmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@PicsSize", bytes.Length))
objCmd.ExecuteNonQuery()

            } 
            else 
                StatusLabel.Text = "Upload status: The file has to be less than 100 kb!"; 
        } 
        else 
            StatusLabel.Text = "Upload status: Only JPEG files are accepted!"; 
    } 
    catch (Exception ex) 
    { 
        StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message; ...