Posted on: 4/9/2013 7:38:19 PM | Views : 250

I am still struggling with this. When I upload a file it goes to a folder called games.
I have a database with gameTitle, gameInformation and fileName.

When i submit the form I enter the game title and information and upload the game file.
How do I get the game file path to store in the fileName on my database?
Here is what I have but I am having no luck!

thanks!

if (fileGame.PostedFile != null) { string fileName = Path.Combine(Server.MapPath("~/games"), fileGame.FileName); //save the file to our local path fileGame.SaveAs(fileName); //Add Entry to DataBase String connASPNETDB = System.Configuration.ConfigurationManager .ConnectionStrings["ASPNETDBConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(connASPNETDB); string st ...

Go to the complete details ...