|
While I am trying to fix this probem I have spotted this:
"I cant use file as the source because it is looking on the machine that is browsing the page. This has nothing to do with ASP.NET, its just basic HTML."
Well after reading this, I put the image file that I want to open in the images folder in my project it does show it on the browser. But why cant I load the image from my hdd and show it in the picture box?
So is there a way to load image from hdd instead of putting it to the images folder in my project. Do you have any recommendations/suggestions?
|
|
|
|
|
To do this, you have to open up the sandbox - in other words, your site is running secured because it runs inside a web server which allows restricted access to the drive. This means that you view a site based on the folder structure registered in the web server - if you need to get access outside, that opens up a whole security nightmare. Why don't you just save the image to a MemoryStream and then stream that down? There's no need to create a physical file then.
|
|
|
|
|
thank you for the answer that solved my problem.
|
|
|
|
|
You're welcome. Glad to be of service.
|
|
|
|
|
Hello,
i hope i am at the right place here.
I can't update a table in my database.
When i execute the update in the gridview i get the error message: ORA-01036: illegal variable name/number
I just want to update the "DVM_LIEFERUNG" table, delete and select statements do their job.
So if anyone of you know how to fix it, let me know it please.
Yours sincerely √ensens
<asp:GridView ID="GridView1" DataKeyNames="L_ID" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Style="position: relative" Width="1000px">
<Columns>
<asp:CommandField CancelText="cancel" DeleteText="del" EditText="edit" InsertText="insert"
NewText="new" SelectText="select" ShowEditButton="True" UpdateText="update" ShowDeleteButton="True" />
<asp:BoundField DataField="NAME" HeaderText="NAME" SortExpression="NAME" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="CONFIGDESCRIPTION" HeaderText="CONFIGDESCRIPTION" SortExpression="CONFIGDESCRIPTION" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="TEST_INTERN" HeaderText="TEST_INTERN" SortExpression="TEST_INTERN" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="TEST_PILOT" HeaderText="TEST_PILOT" SortExpression="TEST_PILOT" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="PRODUKTIV" HeaderText="PRODUKTIV" SortExpression="PRODUKTIV" >
<ItemStyle Width="500px" />
</asp:BoundField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand='SELECT L_ID, PRODUKT_NR, PK_CONFIG_NR, TEST_INTERN, TEST_PILOT, PRODUKTIV, ASP_NR, DVM_PRODUKT.NAME, EMAIL, CONFIGDESCRIPTION FROM DVM_LIEFERUNG, DVM_PRODUKT, AUDAUPDATECONFIGURATIONS, DVM_ASP WHERE DVM_PRODUKT.PRODUKT_ID=DVM_LIEFERUNG.PRODUKT_NR AND AUDAUPDATECONFIGURATIONS.PK_CONFIGID = DVM_LIEFERUNG.PK_CONFIG_NR AND DVM_ASP.ASP_ID = DVM_LIEFERUNG.ASP_NR'
DeleteCommand='DELETE FROM DVM_LIEFERUNG WHERE (L_ID = :L_ID)'
UpdateCommand='UPDATE DVM_LIEFERUNG SET L_ID = :L_ID, PRODUKT_NR = :PRODUKT_NR, PK_CONFIG_NR = :PK_CONFIG_NR, TEST_INTERN = :TEST_INTERN, TEST_PILOT = :TEST_PILOT, PRODUKTIV = :PRODUKTIV, ASP_NR= :ASP_NR WHERE (L_ID = :L_ID)'>
<DeleteParameters>
<asp:ControlParameter ControlID="GridView1" Name="L_ID" PropertyName="SelectedValue" Type="Decimal" />
</DeleteParameters>
<UpdateParameters>
<asp:ControlParameter ControlID="GridView1" Name="L_ID" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="PRODUKT_NR" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="PK_CONFIG_NR" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="TEST_INTERN" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="TEST_PILOT" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="PRODUKTIV" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="ASP_NR" PropertyName="SelectedValue" Type="Decimal" />
</UpdateParameters>
</asp:SqlDataSource>
|
|
|
|
|
Hi,
Never done update in this way but when ODP.Net is used directly you have to either define BindByName to true or define each parameter value even if you use the same names. So you could try to make these modifications:
UpdateCommand='UPDATE DVM_LIEFERUNG
SET L_ID = :L_ID, PRODUKT_NR = :PRODUKT_NR, PK_CONFIG_NR = :PK_CONFIG_NR,
TEST_INTERN = :TEST_INTERN, TEST_PILOT = :TEST_PILOT, PRODUKTIV = :PRODUKTIV, ASP_NR= :ASP_NR
WHERE (L_ID = :L_ID2)' and
...
<asp:ControlParameter ControlID="GridView1" Name="L_ID" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="PRODUKT_NR" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="PK_CONFIG_NR" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="TEST_INTERN" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="TEST_PILOT" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="PRODUKTIV" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="ASP_NR" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="L_ID2" PropertyName="SelectedValue" Type="Decimal" />
The need to optimize rises from a bad design.My articles[^]
modified on Tuesday, March 29, 2011 2:42 PM
|
|
|
|
|
Hi Mika,
first of all thanks for your answer.
Can you descripe how i exactly set BindByName to true?
And is it possible just to update the columns "TEST_INTERN", "TEST_PILOT" and "PRODUKTIV"?
I tried:
<asp:GridView ID="GridView1" DataKeyNames="L_ID" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Style="position: relative" Width="1000px">
<Columns>
<asp:CommandField CancelText="cancel" DeleteText="del" EditText="edit" InsertText="insert"
NewText="new" SelectText="select" ShowEditButton="True" UpdateText="update" ShowDeleteButton="True" />
<asp:BoundField DataField="NAME" HeaderText="NAME" SortExpression="NAME" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="CONFIGDESCRIPTION" HeaderText="CONFIGDESCRIPTION" SortExpression="CONFIGDESCRIPTION" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="TEST_INTERN" HeaderText="TEST_INTERN" SortExpression="TEST_INTERN" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="TEST_PILOT" HeaderText="TEST_PILOT" SortExpression="TEST_PILOT" >
<ItemStyle Width="500px" />
</asp:BoundField>
<asp:BoundField DataField="PRODUKTIV" HeaderText="PRODUKTIV" SortExpression="PRODUKTIV" >
<ItemStyle Width="500px" />
</asp:BoundField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand='SELECT L_ID, L_ID AS L:ID2 PRODUKT_NR, PK_CONFIG_NR, TEST_INTERN, TEST_PILOT, PRODUKTIV, ASP_NR, DVM_PRODUKT.NAME, EMAIL, CONFIGDESCRIPTION FROM DVM_LIEFERUNG, DVM_PRODUKT, AUDAUPDATECONFIGURATIONS, DVM_ASP WHERE DVM_PRODUKT.PRODUKT_ID=DVM_LIEFERUNG.PRODUKT_NR AND AUDAUPDATECONFIGURATIONS.PK_CONFIGID = DVM_LIEFERUNG.PK_CONFIG_NR AND DVM_ASP.ASP_ID = DVM_LIEFERUNG.ASP_NR'
DeleteCommand='DELETE FROM DVM_LIEFERUNG WHERE (L_ID = :L_ID)'
UpdateCommand='UPDATE DVM_LIEFERUNG SET L_ID = :L_ID, PRODUKT_NR = :PRODUKT_NR, PK_CONFIG_NR = :PK_CONFIG_NR, TEST_INTERN = :TEST_INTERN, TEST_PILOT = :TEST_PILOT, PRODUKTIV = :PRODUKTIV, ASP_NR= :ASP_NR WHERE (L_ID = :L_ID2)'>
<DeleteParameters>
<asp:ControlParameter ControlID="GridView1" Name="L_ID" PropertyName="SelectedValue" Type="Decimal" />
</DeleteParameters>
<UpdateParameters>
<asp:ControlParameter ControlID="GridView1" Name="L_ID" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="L_ID2" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="PRODUKT_NR" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="PK_CONFIG_NR" PropertyName="SelectedValue" Type="Decimal" />
<asp:ControlParameter ControlID="GridView1" Name="TEST_INTERN" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="TEST_PILOT" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="PRODUKTIV" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="ASP_NR" PropertyName="SelectedValue" Type="Decimal" />
</UpdateParameters>
</asp:SqlDataSource>
still: ORA-01036: illegal variable name/number
Yours sincerely √ensens
|
|
|
|
|
Hi,
BindByName is a property of OracleCommand class so in your case I'm not sure if you can modify it (unless you have some code behind where yo uactually create the command, add the parameters etc.)
In your current version you're having a column alias L_ID AS L:ID2 which isn't allowed. : means that the next word is the bind parameter name so don't use it elsewhere but in the situations where you handle parameters.
What I'd suggest is that try with much smaller set of parameters, just 1 for the start. If that works, then you can expand the next parameters. This way you'll find which one is causing the trouble. It would be a good idea to simplify the select also in the beginning to see that it's not causing the error.
And about the column updates, yes, if you don't mention any other columns in the update statement only those three will be updated.
|
|
|
|
|
ok First off, I did ask this in quick questions a few days ago but have had zero interest. Thought I would risk the ire of the CP gods and post here one time..
* ducks the lightening bolt*
Anyway the basic problem is this, I have an ASP.net(4.0) app that has a couple embedded reports. These reports are for printing out price tags for our stores(yes the actual physical paper that's put in the neat glass boxes on the shelves.) Two versions, wide and tall. All of the info is based on SQL data that is entered into the database using other parts of my app. This includes some image columns that are uploaded as byte streams not as url links.
The wides are not an issue, but are mentioned just for reference. I have those built with no troubles at all they are approximately 6 inches wide and 3 inches tall, two per page when exported out to a pdf.
The issue comes in on the talls. Approximately 7 inches tall and 3 inches wide. They have the same exact info as the wides. When built "upright" as you would look at it I have no trouble building them but.. I get only one per page. The powers that be rightly think this is a waste of paper.
If I build the talls laying on their "side" as it were I can get 3 per page(saving paper) but I have one major issue with that. I have figured out how to do the text vertical since that was easy, but For the life of me I cannot figure out how to make the images vertical. Keeping in mind these are dynamic images out of the database not static images that I can embed, and each pricetag has different images based on user defined settings. Again I can get the images with no trouble, its how to make them vertical that is driving me insane. I have googled for two weeks,read dozens of sites/posts, I have poked and prodded every control and button I can find in VS to no avail. Is this even doable?
Just as a background, our company is a cell phone retailer, and the pricetags are for the actual phones. So each tag is for a different model phone with its pricing and options. The options are the images that are in issue. The guy in corporate that handles those would input the info, use a page in my app to set up a phone and its pricing, then "print" the report(containing all the phones) to a pdf which is then sent to a printer such as officemax for distribution to the stores( we have over 70 of them)I figured all that out except these dang images. I can happily send a screen snip of the reports to any interested parties. I have them done except for the image part so its fairly easy to see what I'm after.
brainstorm.. der...
wide version
http://i236.photobucket.com/albums/ff30/gavindon/printwide.jpg
tall version
http://i236.photobucket.com/albums/ff30/gavindon/printtall.jpg
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
modified on Tuesday, March 29, 2011 10:25 AM
|
|
|
|
|
Hello!
I'm trying to find a code to delete multiple columns because when you delete a column the next column takes his place so for example:
If you delete column 6 then column 7 becomes column six.
I tried the following code with an for loop & a while loop:
Dim field As DataControlField = gv.Columns(i)
gv.Columns.Remove(field)
&
gv.columns.removeat(i)
But same case that the column 7 becomes column 6
The variable removeColumns is an array with the column number that need to be deleted.
If wanted I can also provide the Header Names
Thanks a lot for anyone who can Help me!
Imports System.Data
Imports System.Configuration
Imports System.IO
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Public Class GridViewExportUtil
Public Shared Sub Export(ByVal fileName As String, ByVal gv As GridView, ByVal removeColumns As Integer())
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", fileName))
HttpContext.Current.Response.ContentType = "application/ms-excel"
'Gridview column delete code should come here
Using sw As New StringWriter()
Using htw As New HtmlTextWriter(sw)
' Create a form to contain the grid
Dim table As New Table()
' add the header row to the table
If gv.HeaderRow IsNot Nothing Then
GridViewExportUtil.PrepareControlForExport(gv.HeaderRow)
table.Rows.Add(gv.HeaderRow)
End If
' add each of the data rows to the table
For Each row As GridViewRow In gv.Rows
GridViewExportUtil.PrepareControlForExport(row)
table.Rows.Add(row)
Next
' add the footer row to the table
If gv.FooterRow IsNot Nothing Then
GridViewExportUtil.PrepareControlForExport(gv.FooterRow)
table.Rows.Add(gv.FooterRow)
End If
' render the table into the htmlwriter
table.RenderControl(htw)
' render the htmlwriter into the response
HttpContext.Current.Response.Write(sw.ToString())
HttpContext.Current.Response.[End]()
End Using
End Using
End Sub
|
|
|
|
|
Hi All,
We use Paypal in our asp.net(c#) application like this.
" />
when the transcation is sucessfull... how to get the transcation id to check the status?
Please help
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
When your transaction is successful you will receive 'txn_id' variable from Paypal where you can find your transaction.
|
|
|
|
|
Thank..
Could you be still clear to me..
how to access txn_id ..I need to save in my local DB.
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
When your payment successful PayPal post data to your success URL.
Now here PayPal post different variables to this URL .
The 'txn_id' is one of those variable PayPal post in success url.
So you need to get that variable with Request object and you will get Transaction ID.
Hope this Help.
|
|
|
|
|
It works.. Thanks for your support.
I have another issue in testing in sandbox.
when i run the page, it showing me
"Please login to use the PayPal Sandbox features."
and offen getting cookie issue.
apologize for asking all silly things.
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
I want to make function.
If i upload video file or flash in somewhere.
Client pc can see popup windows which can show video or flash.
So, ASP.net can do?
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
buffering83 wrote: So, ASP.net can do?
Yes it can.
You need to use HTML <object> tag to link this video.
|
|
|
|
|
Oh, Thank you!
This is what i want!!
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Hi all,
I have the Textbox inside Update Panel like below
<td colspan="4" style="border: none;">
<asp:UpdatePanel ID="upnl_PeriodYears" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="txtPeriodFromDate" runat="server" Width="90px" ValidationGroup="LandAcqForm" Text='<%#(((System.Data.DataRowView)Container.DataItem).DataView.Table.Columns.Contains("DBFromDate")? Eval("DBFromDate") : "FromDate") %>'></asp:TextBox>
But iam getting the below error
CS1061: 'System.Web.UI.Control' does not contain a definition for 'DataItem' and no extension method 'DataItem' accepting a first argument of type 'System.Web.UI.Control' could be found (are you missing a using directive or an assembly reference?)
How i assign the value to Textbox which is inside Update Panel???
Regards
|
|
|
|
|
|
Cool, god bless Google, gonna get that in mind, just a question... an update panel is used for what? to retrieve data from table and refresh it, in order to keep it updated ? like doing it with AJAX?
Thanks!
|
|
|
|
|
msqar wrote: just a question... an update panel is used for what? to retrieve data from table and refresh it, in order to keep it updated ? like doing it with AJAX?
Here you go....simple & explained nicely
What is the UpdatePanel in ASP.NET Ajax?[^]
BTW you welcome
|
|
|
|
|
Hi All,
I need to integrate Paypal with my web site(asp.net with c#)
I created paypal sandbox account, but still do not have clear idea of how to integrate.
Please help me with...
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
|
Hi,
Check this out http://www.asp.net/downloads/starter-kits/paypal-ecommerce/
OR
You need a paypal account and you have to sign up for a business account so you can accept credit card payments.
There are some clever ways to integrate it but I have illustrated one of the most basic ways here:
http://runtingsproper.blogspot.com/2009/07/simple-paypal-button.html
That would get you going with a purchasable item. You will have to dig deeper if you want to add items to a cart and then purchase them all at once.
There is a dedicated developer network called the PayPal Developer Network.
https://www.paypal.com/developer
http://developer.paypal-portal.com/pdn/
And many many tutorials out there:
http://www.google.co.uk/search?q=asp.net+paypal
Hope it helps
Regards
|
|
|
|
|