Access :: Showing All ProductID's, It Shows Only 1 ProductID?
Jun 6, 2010
im trying to display data from an acces database.the problem however is that, instead of showing all productID's, it shows only 1 productID and its price.im new to sql and asp.net so im having a hard time getting this done.im doing this in C#.i should note that,after i figure this out, the productID's need to be clickable so it will redirect u to that productID's personal page.in short, a webshop kind of idea.my code in the aspx.cs currently looks like this,
protected void Page_Load(object sender, EventArgs e){OleDbConnection verbinding = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/LOCATION/mydatabase.mdb");try{verbinding.Open();if (verbinding.State.ToString() == "Open"){string sqlstr = "SELECT ProductID, price FROM Product WHERE Producttype='Jeans'";
Given the above scenario, I would have thought that submitting the form with a blank ProductId would have been fine because I didn't decorate the ProductId property with [Required]. However I get the error message "The ProductId field is required".
Is there any way to make an Integer property on the model not required?
i have two tables in my database, product(productid as pk) and productdetails(productid as fk), in a relationship.i have dropdownlist which on pageload displays data from my product table, showing all product name. AutoPostBack enabled. Its working fine.i have a gridview which should display the productdetails data when i select a value from my dropdown list.i have written the code for the gridview on the selected_index_change event of the drop down list, please correct me this is wrong;here is the code;
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged Dim ConString As String [code]...
so when i select the value in the dropdownlist i get this error .Must declare the scalar variable "@ProductID".
i am trying to show videos oon the asp.net page here is the code that i am using but it shows me a open save file dialog and i don't want that i want a player on my website it should show that video data from database i am using sql server and datatype in varbinary(max) & using linq to sql to store data
ELearnDataContext eld = new ELearnDataContext(); var x = (from a in eld.Videos where a.VideoID== 1 select a).First(); Response.Clear(); Response.ClearHeaders(); Response.Charset = "GB2312"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.ContentType = "application/OCTET-STREAM"; Response.ContentType = "video/x-ms-wmv"; Response.AddHeader("Content-Disposition", "attachment; filename=" + x.FileName); Response.AddHeader("Content-Length",x.Videodata.Length.ToString()); Response.BinaryWrite(x.Videodata.ToArray()); Response.Flush(); Response.End();
i have created a blank asp.net website consisting of a blank default.aspx page, its .cs file, a login.aspx page and its .cs and a web.config. im looking to test .net authentication as seen in here: http://msdn.microsoft.com/en-us/library/xdt4thhy.aspx on the msdn site. ive copied everything as shown in the atricle. i set up the site in iis6 now when i go to the site i get the runtime error with the
"To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off"." message. when i add the customErrors mode="On" tag to the web.config i still get this error like its not looking at the web.config. ive triple checked iis and its definitely looking at the right site folder. heres my web.config:
I have a small Access database with some fields, like: date, name, text. Those fields are stored in a record inside MS Access. I also have an PDF file available belonging to that record as described before. I like to store the title of this PDF also in this record. Clicking by an user on this title should show the PDF file in a separate form. The pdf's are all stored in a map called e:pdfs and filename can be as needed. My questions are:
1. how should i bring the pdf names inside the record (like e:pdfsumber-one.pdf ? ) 2. by clicking on this name the pdf file should be showed in a seperate form? 3. clicking means probably a javascript that handles the pdf file ? 4. can anyone give me some clues? I do work with VS2010 and framework 4
I am creating virtual directory from my C# code when i execute this code working every finely.
But problem is when i publish this code and access through iis it is showing an error as access denied .
i tried to give permissions to the folder in c:\inetpub\wwwrootfoldername Network service and users provided permissions of full control But still showing an error of Access Denied(mine is iis 5.0 in xp)
Is there anything missing in IIS 6.0 that prevents me from (Insert into table) using MS-Access?
Explain: The application works fine under Visual Studio 2008 IDE the insert into table works fine with no error, Also I tested with hosting provider and works fine with no problem. but now I have published the same exact app in a dedicated server windows 2003 with IIS 6.0 .NET framework 2.0 with latest service pack I gave IIS_WPG write/modify access to the folder where MS-Access database is located and database but at the time of insert an error pop-up. I need to install in the Server or settings in the IIS to recognize my MS-Access db is it some office runtime that I am missing. (BTW I am using OLEDB connection string in my C# )
Using System.Data.OleDb;
I can retrieve data off of it with no problem but when I try to insert is when it fails I thought the problem was Access Rights but I do not think is the case.
Sometimes my parts of my pages are displaying in ??? this parts connects to the DB (MySQL) and contain hebrew data.The thing is that it only happen sometimes and not allways.
I have a ModalPopupExtender that I call when the user click on a button. In the popup, I have a textbox where I want to put today's date, but I only want to do it when ModalPopupExtender shows (or when the user click on the button). The problem is the click event of the button isn't fired on server side when I clicked on the button and ModalPopupExtender doesn't have any Show event.
I have a radMenu on the main site.master form which shows on a page. The page has a radGrid with a button to open a radWindows that shows a report. When the radWindow opens everything works great but the radMenu shows through onto the Window. How do I prevent the menu from showing through on the window.
This works as i would expect in IE8, where it displays the div when you click the header link, and then hides it when clicking the header link again. However, in Firefox, nothing happens when i click the header link.I'm assuming this is to do with IE being forgiving of an error i have made, and Firefox sticking to the rules, but i can't see what i am doing wrong.
I have created a Entity named MediaItem which is Abstract and Game inherits form it. I create the database automatically and I get a table MediaItems and MediaItems_Game.
The issue is when I do the following in my ASP.Net Controller:
private Models.DBContainer dataModel = new DBContainer();
dataModel. ---> Intellisense shows me MediaItem but I can find no way to either navigate to or use MediaItems_Game, how can I solve this? i.e. How can I grab a list of 'Games' with some 'WHERE' constraints on another table (not pictured).
I'm developing an app with asp.net and jQuery and I have a strange problem, I have the div(used as dialog) and a button to show the dialog, the first time I call the dialog, it shows correctly, I close it but when I try to show for the second time the background grays but the dialog doesn't show (only in IE in firefox it works fine). Is there a way to fix this? Or maybe I'm doing somethign wrong.
1. Is it possible to have a list control in ASP.NET which shows images. If yes, kindly tell me how.
I have managed to create a gridview control which shows an hyperlink with image in each row. The problem is that when the user selects the hyperlink it results in a GET operation which resets everything on my page. I need to have a postback rather than a GET.
It will be cool to have a list which can show images, because then I can simple do a Autopostback on itemselect.
When I look at the master page in VWD, I can see the logo image. When I hit F5 to view in the browser, I don't see anything but a square with an X where the image should be. I've checked my path of the image by looking at its properties, and it is correct. The path to the image is "C:BalloonShopImages". In VWD, "C:BalloonShop" is my root/project directory. I also have the Images folder added to my project.
I've done this successfully before, but now i'm scratching my head trying to figure out why i'm only getting the 1st record this time. i've debugged the code and verified that the datasource is returning 300+ records, however the report viewer only shows 1 page and the Next button is disabled.
Where LK_URL is pointing to a file in the PDFs folder. In this case I have connected to the server and removed a particular PDF but the link still works. I have deleted all my cache (internet tools - temp files delete all) but it still works. This has come about because someone made a change to a PDF, I uploaded it overriding the original. I see the new one on my PC but he still see's the original.
I am outputting the content of a page from a subroutine. The weird thing is, the code behind is writing this to my aspx page. <asp:Hyperlink ID="HyperLink1" runat="server" CssClass="HoverMenuText">more</asp:HyperLink> When the page is viewed live, the hyperlink is not a hyperlink because using the browser to "View Source", the html shows the exact same line! It wasn't converted to the format like "<a id="ctl00_ContentPlaceHolder1_HyperLinkHover">HoverMenuTest</a>" So for some reason, the server is not converting this asp control to an html control. Any ideas why it wouldn't do that?
As you can see, it is populated by a method. This method checks whether the item is checked or not (when updating the data shown in the detailsview)
[Code]....
Now when I click the update button, the button that triggers the itemupdating event, I delete all links in the database connected to that record, loop through all my checkboxlists and insert the ones that are checked:
[Code]....
The problem however is in this line:
[Code]....
For some reason the items are counted double and I cannot find the reason for that. Dividing it by two does solve it but it would be nicer to understand why it does that.(And if there would be a better way to loop through all the controls to find all checkboxes.