Showing posts with label access. Show all posts
Showing posts with label access. Show all posts

Saturday, March 31, 2012

Submitting value from a hidden form field

I have a form inserting into an access database, 1 of the fields is hidden and required.
When I click submit the insert fails, if I change the visible value to "true" the insert succeeds.
I know this is probably really simple but I can't figure it out.If you set a controls visibility to false then it doesn't appear in the rendered HTML, therefore your hidden field won't be there at all (check the HTML source). In order to make a control still contain a value but be readonly try using the enabled property and set it to fale instead eg

<asp:TextBox id="myTextBox" enabled="false" runat="server"/>

That way the value is retained but it can't be changed.

Other option is to use a 'traditional' <input type="hidden"> field.
Thanks but the value has to be editable. The hidden field is actually receiving a date that is selected from a calendar on the page using this:


void Selection_Change(Object sender, EventArgs e)
{
countDate.Text = calendar.SelectedDate.ToShortDateString();
}

Where countDate is the hidden field.

If there is an easier way to do this please let me know.
As was explained,

you could use:

<input type="hidden"runat="server" ID="countDate"
Then just the code would be:


countDate.Value = calendar.SelectedDate.ToShortDateString();

Thanks, that worked.

I now have another problem, when changing the date on the calendar it appears to be trying to submit the form, causing error messages as some other fields are also required.

subst command or maybe network access issue

I'm trying to open an xml document on my computer. It is on a subst drive
f. I get a System.IO.DirectoryNotFoundException when I try to open the
file. When I switch to the C drive it works fine. I gave aspnet user admin
right to make sure it wasn't a permission problem but I am still getting the
exception whatever I do unless I look at my C drive. Any idea what gives?

Thanks guys.
Chris"Chris" <cf@.NoSpamzieQuotepro.com> wrote in
news:e2H7fPO9DHA.2432@.TK2MSFTNGP10.phx.gbl:
> I'm trying to open an xml document on my computer. It is on a subst
> drive f. I get a System.IO.DirectoryNotFoundException when I try to
> open the file. When I switch to the C drive it works fine. I gave
> aspnet user admin right to make sure it wasn't a permission problem but
> I am still getting the exception whatever I do unless I look at my C
> drive. Any idea what gives?

Are the other drives you having trouble with by chance network drives?

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Wednesday, March 28, 2012

Subtracting Quantities

Hi,

I have a query about updating quantity values within an website written in asp.net 1.1, vb2003 which references an access database. Basically what I want to do is when the customer confirms their order, I want then the number of items purchased to then be subtracted from the Products table in the database. Thus this ensures the number of each item in stock is kept up to date within the database.

My checkout table contains the intCartitemID (autonumber), Cart ID (random number and date value), quantity ordered and the productID for the item purchased.

The products table contains the ProductID, description, attributes, sale price and quantities in stock.

Now I assume I need to take the quantity of item purchased from the checkout table and then subtract this value from the products table. However, how do I put this idea into practice in terms of the asp.net coding ?

Any online examples of coding would help.

Thanks,

Just pass it in a SQL query

"Update productsTable set quantity = quantity - 1 where productID = " & productID


I agree with the above, except not "quantity = quantity - 1" ... but rather "quantity = quantity - @.howMuchWasOrdered"


Thanks both...Smile

Monday, March 26, 2012

Suggestion needed for huge DataGrid

Hi all:
Our web site uses 3-tier structure, the middle tier is a web service. We
also use Microsoft Data Access Application Block to access sql server.
Now I have to display a DataGrid with huge amount of data on web page,
of course the DataGrid has pager. But even though, the web service still
will return full DataSet to web server, and let web server to handle pages.
Since Microsoft Data Access Application Block does not support
SqlDataAdapter.Fill(DataSet, startReocrd, maxRecord, tableName) to reduce
the size of DataSet. Do you think there is a better way to improve
performace?
Yes, I can always extend Microsoft Data Access Application Block and
build my own pager.

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours HardyHi Hardy,

May I suggest two solutions:
-if the full set of lines is going to be requested sooner or later, fill the
DataSet and place it in the Cache for the first time, then read it from the
Cache.
-if you don't need the full set of lines, you may use the SqlDataReader
combined with a TOP N command in your SQL query.
--
To reply, remove a "l" before the @. sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net

Saturday, March 24, 2012

Sum Calculation Query

Hi,

Within an access database I want to be able to add some values and calculate the sum of these values. Using asp.net 1.1. with vb.net, how would I achieve this ?

Presumably I could perform a look up within the databse and then use sind kind of function to add the required values ? Can anyone offer any suggestions or point to any useful online examples ?

Thanks,

reather than use asp.net to add up your columns why not use your datasource to do this.

like an sql query:

select sum(amount)

From TBLIntegerHolder

where amount > 0

something like that


Write a query within access to do the necessary data manipulation and the read the result.

Hi,

Use sum() function in the sql query.


Thanks all

sunken in textboxes anyone?

Hi folks,
first of all I'm using ASP.net 1.1 with C#

In the good old MS Access days you had sunken in textboxes to tell users
that they could type stuff in that box and flat textboxes to indicate a 'read
only' intention.
my colleagues and I are developing on an Intranet with IE6 only...

I notice that all my ASP.net <asp:textbox> come out flat in IE6 on my XP Pro
machine. is there anywhere or any way I can make those <asp:textbox> controls
appear sunken in, in some cases, and flat in others?

Regards and thanks in advance,
CharlesAHi Charles,

Try adding this to your CSS stylesheet:

input.sunken
{
border: 2px inset;
}

Then set the CssClass property of your TextBox to "sunken".

HTH,

Chris
Thanks for that Chris!

sunken in textboxes anyone?

Hi folks,
first of all I'm using ASP.net 1.1 with C#
In the good old MS Access days you had sunken in textboxes to tell users
that they could type stuff in that box and flat textboxes to indicate a 'rea
d
only' intention.
my colleagues and I are developing on an Intranet with IE6 only...
I notice that all my ASP.net <asp:textbox> come out flat in IE6 on my XP Pro
machine. is there anywhere or any way I can make those <asp:textbox> control
s
appear sunken in, in some cases, and flat in others?
Regards and thanks in advance,
CharlesAHi Charles,
Try adding this to your CSS stylesheet:
input.sunken
{
border: 2px inset;
}
Then set the CssClass property of your TextBox to "sunken".
HTH,
Chris
Thanks for that Chris!

Thursday, March 22, 2012

Supress error/warning of winapi in class?

I have this error:
Warning 1 Access of shared member, constant member, enum member or nested
type through an instance; qualifying expression will not be evaluated...
This because i have a call in a win32 dll:
Public Declare Ansi Function TheCall Lib "MyDll.DLL" Alias "TheCall" (ByVal
szKey As String) As Int32
Option Explict or Strict don't do anything here.
I'm looking for a solution hopefully placed in the class itself if possible.
The call is executed through the dimensioned class var.
'you are referencing a static method from an instance rather than its class.
use ClassName.MethodName (class referenece), not myObj.MethodName (instance
reference)
-- bruce (sqlwork.com)
"Edwin Knoppert" <news@.hellobasic.com> wrote in message
news:439eef25$0$2339$ba620dc5@.text.nova.planet.nl...
>I have this error:
> Warning 1 Access of shared member, constant member, enum member or nested
> type through an instance; qualifying expression will not be evaluated...
> This because i have a call in a win32 dll:
> Public Declare Ansi Function TheCall Lib "MyDll.DLL" Alias "TheCall"
> (ByVal szKey As String) As Int32
> Option Explict or Strict don't do anything here.
> I'm looking for a solution hopefully placed in the class itself if
> possible.
> The call is executed through the dimensioned class var.
> '
>
Hey, thanks, thought the declares where not public, brain-dead of course.
It says: PUBLIC :)
To bad i couldn't reuse my WITH statement with these calls.
I swapped it for the dimmed object but MS does not like that :)
Thanks,
"Bruce Barker" <brubar_nospamplease_@.safeco.com> schreef in bericht
news:eMrI3rAAGHA.1268@.TK2MSFTNGP11.phx.gbl...
> you are referencing a static method from an instance rather than its
> class. use ClassName.MethodName (class referenece), not myObj.MethodName
> (instance reference)
> -- bruce (sqlwork.com)
>
> "Edwin Knoppert" <news@.hellobasic.com> wrote in message
> news:439eef25$0$2339$ba620dc5@.text.nova.planet.nl...
>

Tuesday, March 13, 2012

Switch from ASPNET/NETWORK SERVICE Account

Hi,

I have a page which requests info from a number of machines and whenever I try to do this I get an 'access is denied' error message. How do I change the account that my page is using to one which actually has access to the machines.

Thanksthere is not really a straight-forward answer to this.

if all of these servers are on the same domain, then you will ba able to impersoninate a common user in the web.config ..

<identity impersonate="true" userName="domain_name\user" password="password"/
make sure this user has the appropiate permissions on all the folders your are trying to access.

by default, the ASP.NET Machine Account is used for all requests.

psi
thanks psi
see if the framework and/or the ASP.NET Machine Account is on all machines ... if it is, and all the servers are on the same domain, you should be able to set the service to network service ...

psi
Is there any other way I could do this? There is a single account on the domain that I can use but its password is changed frequently and it is a account which my boss would prefer not to have hard-coded into the web.config file.

Thanks again,
Tomas