Thursday, March 29, 2012

Newbie: Image button aspect ratio

I have some image buttons which I am dynamically adding from a database. No
problems so far...
However, when it loads the image using IMAGEURL=, it doesn't keep the
original aspect ratio.
Is there a way to keep this without resizing the control?
Many thanks,
David Whitchurch-BennettThe aspect ratio is not affected at all by the ImageURL property. Most
likely you have the height or width of the control set to a value. If you
remove those values from the control, the image will come in at its normal
size, if you want it smaller (but wish to preserve the aspect ratio), then
just set a width or a height for the control but not both.
"David Whitchurch-Bennett"
<DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
news:11381908-84A6-467F-99A3-B274561AA68D@.microsoft.com...
>I have some image buttons which I am dynamically adding from a database. No
> problems so far...
> However, when it loads the image using IMAGEURL=, it doesn't keep the
> original aspect ratio.
> Is there a way to keep this without resizing the control?
> Many thanks,
> David Whitchurch-Bennett
>
Thanks for that information. What I have in my app is an image button set to
250 x 250, with a thick border which is all part of the visual theme. That i
s
why I have set the size first. What I want to do is load an image dynamicall
y
in the center of the image button, but keep the image button border the same
size, so the visual theme is preserved.
Is this possible, or will the only way be to place the image button into
another container with a border.
"Scott M." wrote:

> The aspect ratio is not affected at all by the ImageURL property. Most
> likely you have the height or width of the control set to a value. If you
> remove those values from the control, the image will come in at its normal
> size, if you want it smaller (but wish to preserve the aspect ratio), then
> just set a width or a height for the control but not both.
> "David Whitchurch-Bennett"
> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
> news:11381908-84A6-467F-99A3-B274561AA68D@.microsoft.com...
>
>
I think this is more of an issue of having graphics that will fit into a
250x250 space that VS.NET sizing the images for you. Your best bet is to
use a good graphics tool to create images that will fit into that space,
rather than attempt to have VS.NET fit them for you.
"David Whitchurch-Bennett"
<DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
news:B4825793-D8BD-476C-96B8-9E63062C1B6F@.microsoft.com...
> Thanks for that information. What I have in my app is an image button set
> to
> 250 x 250, with a thick border which is all part of the visual theme. That
> is
> why I have set the size first. What I want to do is load an image
> dynamically
> in the center of the image button, but keep the image button border the
> same
> size, so the visual theme is preserved.
> Is this possible, or will the only way be to place the image button into
> another container with a border.
> "Scott M." wrote:
>
I already have this. I am using a class that I have written to scale down th
e
image first for two reasons.
1. To help the page load faster.
2. To prevent people downloading the full size images (photographic website)
.
Rather than resizing all of my photos, my class takes care of this by
scaling down the image. I pass the maximum width and height, and the image i
s
scaled down to fit and it maintains the aspect ratio.
When I put the scaled down image into the button, it stetches it out to fit
in both dimensions.
I guess I just asumed there would be a way to display the image without
stretching it out. I can pad the extra pixels in the function to return a
square image if that is a better way.
Thanks for your help. ASP.NET is quite different to what I am used to, but I
am getting there!
"Scott M." wrote:

> I think this is more of an issue of having graphics that will fit into a
> 250x250 space that VS.NET sizing the images for you. Your best bet is to
> use a good graphics tool to create images that will fit into that space,
> rather than attempt to have VS.NET fit them for you.
> "David Whitchurch-Bennett"
> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
> news:B4825793-D8BD-476C-96B8-9E63062C1B6F@.microsoft.com...
>
>
How about putting the image into an image control (not a button image
control) and overlaying the image control on top of your button control?
"David Whitchurch-Bennett"
<DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
news:C9567572-5BBC-4DE9-83C9-44BE4F3465F4@.microsoft.com...
>I already have this. I am using a class that I have written to scale down
>the
> image first for two reasons.
> 1. To help the page load faster.
> 2. To prevent people downloading the full size images (photographic
> website).
> Rather than resizing all of my photos, my class takes care of this by
> scaling down the image. I pass the maximum width and height, and the image
> is
> scaled down to fit and it maintains the aspect ratio.
> When I put the scaled down image into the button, it stetches it out to
> fit
> in both dimensions.
> I guess I just asumed there would be a way to display the image without
> stretching it out. I can pad the extra pixels in the function to return a
> square image if that is a better way.
> Thanks for your help. ASP.NET is quite different to what I am used to, but
> I
> am getting there!
> "Scott M." wrote:
>
I ran into the same problem... I found an easy to solution to prevent scalin
g is to use a hyperlink control and set its imageurl property to the image i
n question.

Newbie: Image button aspect ratio

I have some image buttons which I am dynamically adding from a database. No
problems so far...

However, when it loads the image using IMAGEURL=, it doesn't keep the
original aspect ratio.

Is there a way to keep this without resizing the control?

Many thanks,

David Whitchurch-BennettThe aspect ratio is not affected at all by the ImageURL property. Most
likely you have the height or width of the control set to a value. If you
remove those values from the control, the image will come in at its normal
size, if you want it smaller (but wish to preserve the aspect ratio), then
just set a width or a height for the control but not both.

"David Whitchurch-Bennett"
<DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
news:11381908-84A6-467F-99A3-B274561AA68D@.microsoft.com...
>I have some image buttons which I am dynamically adding from a database. No
> problems so far...
> However, when it loads the image using IMAGEURL=, it doesn't keep the
> original aspect ratio.
> Is there a way to keep this without resizing the control?
> Many thanks,
> David Whitchurch-Bennett
Thanks for that information. What I have in my app is an image button set to
250 x 250, with a thick border which is all part of the visual theme. That is
why I have set the size first. What I want to do is load an image dynamically
in the center of the image button, but keep the image button border the same
size, so the visual theme is preserved.

Is this possible, or will the only way be to place the image button into
another container with a border.

"Scott M." wrote:

> The aspect ratio is not affected at all by the ImageURL property. Most
> likely you have the height or width of the control set to a value. If you
> remove those values from the control, the image will come in at its normal
> size, if you want it smaller (but wish to preserve the aspect ratio), then
> just set a width or a height for the control but not both.
> "David Whitchurch-Bennett"
> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
> news:11381908-84A6-467F-99A3-B274561AA68D@.microsoft.com...
> >I have some image buttons which I am dynamically adding from a database. No
> > problems so far...
> > However, when it loads the image using IMAGEURL=, it doesn't keep the
> > original aspect ratio.
> > Is there a way to keep this without resizing the control?
> > Many thanks,
> > David Whitchurch-Bennett
>
I think this is more of an issue of having graphics that will fit into a
250x250 space that VS.NET sizing the images for you. Your best bet is to
use a good graphics tool to create images that will fit into that space,
rather than attempt to have VS.NET fit them for you.

"David Whitchurch-Bennett"
<DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
news:B4825793-D8BD-476C-96B8-9E63062C1B6F@.microsoft.com...
> Thanks for that information. What I have in my app is an image button set
> to
> 250 x 250, with a thick border which is all part of the visual theme. That
> is
> why I have set the size first. What I want to do is load an image
> dynamically
> in the center of the image button, but keep the image button border the
> same
> size, so the visual theme is preserved.
> Is this possible, or will the only way be to place the image button into
> another container with a border.
> "Scott M." wrote:
>> The aspect ratio is not affected at all by the ImageURL property. Most
>> likely you have the height or width of the control set to a value. If
>> you
>> remove those values from the control, the image will come in at its
>> normal
>> size, if you want it smaller (but wish to preserve the aspect ratio),
>> then
>> just set a width or a height for the control but not both.
>>
>> "David Whitchurch-Bennett"
>> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
>> news:11381908-84A6-467F-99A3-B274561AA68D@.microsoft.com...
>> >I have some image buttons which I am dynamically adding from a database.
>> >No
>> > problems so far...
>>> > However, when it loads the image using IMAGEURL=, it doesn't keep the
>> > original aspect ratio.
>>> > Is there a way to keep this without resizing the control?
>>> > Many thanks,
>>> > David Whitchurch-Bennett
>>>
>>
>
I already have this. I am using a class that I have written to scale down the
image first for two reasons.

1. To help the page load faster.
2. To prevent people downloading the full size images (photographic website).

Rather than resizing all of my photos, my class takes care of this by
scaling down the image. I pass the maximum width and height, and the image is
scaled down to fit and it maintains the aspect ratio.

When I put the scaled down image into the button, it stetches it out to fit
in both dimensions.

I guess I just asumed there would be a way to display the image without
stretching it out. I can pad the extra pixels in the function to return a
square image if that is a better way.

Thanks for your help. ASP.NET is quite different to what I am used to, but I
am getting there!

"Scott M." wrote:

> I think this is more of an issue of having graphics that will fit into a
> 250x250 space that VS.NET sizing the images for you. Your best bet is to
> use a good graphics tool to create images that will fit into that space,
> rather than attempt to have VS.NET fit them for you.
> "David Whitchurch-Bennett"
> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
> news:B4825793-D8BD-476C-96B8-9E63062C1B6F@.microsoft.com...
> > Thanks for that information. What I have in my app is an image button set
> > to
> > 250 x 250, with a thick border which is all part of the visual theme. That
> > is
> > why I have set the size first. What I want to do is load an image
> > dynamically
> > in the center of the image button, but keep the image button border the
> > same
> > size, so the visual theme is preserved.
> > Is this possible, or will the only way be to place the image button into
> > another container with a border.
> > "Scott M." wrote:
> >> The aspect ratio is not affected at all by the ImageURL property. Most
> >> likely you have the height or width of the control set to a value. If
> >> you
> >> remove those values from the control, the image will come in at its
> >> normal
> >> size, if you want it smaller (but wish to preserve the aspect ratio),
> >> then
> >> just set a width or a height for the control but not both.
> >>
> >> "David Whitchurch-Bennett"
> >> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
> >> news:11381908-84A6-467F-99A3-B274561AA68D@.microsoft.com...
> >> >I have some image buttons which I am dynamically adding from a database.
> >> >No
> >> > problems so far...
> >> >> > However, when it loads the image using IMAGEURL=, it doesn't keep the
> >> > original aspect ratio.
> >> >> > Is there a way to keep this without resizing the control?
> >> >> > Many thanks,
> >> >> > David Whitchurch-Bennett
> >> >>
> >>
> >>
>
How about putting the image into an image control (not a button image
control) and overlaying the image control on top of your button control?

"David Whitchurch-Bennett"
<DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
news:C9567572-5BBC-4DE9-83C9-44BE4F3465F4@.microsoft.com...
>I already have this. I am using a class that I have written to scale down
>the
> image first for two reasons.
> 1. To help the page load faster.
> 2. To prevent people downloading the full size images (photographic
> website).
> Rather than resizing all of my photos, my class takes care of this by
> scaling down the image. I pass the maximum width and height, and the image
> is
> scaled down to fit and it maintains the aspect ratio.
> When I put the scaled down image into the button, it stetches it out to
> fit
> in both dimensions.
> I guess I just asumed there would be a way to display the image without
> stretching it out. I can pad the extra pixels in the function to return a
> square image if that is a better way.
> Thanks for your help. ASP.NET is quite different to what I am used to, but
> I
> am getting there!
> "Scott M." wrote:
>> I think this is more of an issue of having graphics that will fit into a
>> 250x250 space that VS.NET sizing the images for you. Your best bet is to
>> use a good graphics tool to create images that will fit into that space,
>> rather than attempt to have VS.NET fit them for you.
>>
>> "David Whitchurch-Bennett"
>> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
>> news:B4825793-D8BD-476C-96B8-9E63062C1B6F@.microsoft.com...
>> > Thanks for that information. What I have in my app is an image button
>> > set
>> > to
>> > 250 x 250, with a thick border which is all part of the visual theme.
>> > That
>> > is
>> > why I have set the size first. What I want to do is load an image
>> > dynamically
>> > in the center of the image button, but keep the image button border the
>> > same
>> > size, so the visual theme is preserved.
>>> > Is this possible, or will the only way be to place the image button
>> > into
>> > another container with a border.
>>> > "Scott M." wrote:
>>> >> The aspect ratio is not affected at all by the ImageURL property.
>> >> Most
>> >> likely you have the height or width of the control set to a value. If
>> >> you
>> >> remove those values from the control, the image will come in at its
>> >> normal
>> >> size, if you want it smaller (but wish to preserve the aspect ratio),
>> >> then
>> >> just set a width or a height for the control but not both.
>> >>
>> >> "David Whitchurch-Bennett"
>> >> <DavidWhitchurchBennett@.discussions.microsoft.com> wrote in message
>> >> news:11381908-84A6-467F-99A3-B274561AA68D@.microsoft.com...
>> >> >I have some image buttons which I am dynamically adding from a
>> >> >database.
>> >> >No
>> >> > problems so far...
>> >>> >> > However, when it loads the image using IMAGEURL=, it doesn't keep
>> >> > the
>> >> > original aspect ratio.
>> >>> >> > Is there a way to keep this without resizing the control?
>> >>> >> > Many thanks,
>> >>> >> > David Whitchurch-Bennett
>> >>> >>
>> >>
>> >>
>>
>>
>

newbie: I wonder if this is possible in asp.net 2.0

Hey
asp.net 2.0
As far as I know it's possible to search the users registrered at a asp.net
2.0 web portal using either username or e-mail.
But what about the custom profile properties which can be configured in
web.config? Can they be searched too? I guess it can by using foreach loop
and test the contents on every user object.. but I thought maybe there was a
cleaner and faster way to do it...
Lets say for example these are custom profile settings in web.config. any
suggestion on how to search them? Lets say the search should return all
users containing the phrase "Lets" in lastname? or all users of a specific
gender?
<profile enabled="true">
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<add name="Gender" type="string"/>
<add name="BirthDate" type="DateTime"/>
</properties>
</profile>
Best RegardsThis article should help, and even fleshes out some of the sample code
provided by one of the MS people for it:
http://www.eggheadcafe.com/articles/20060731.asp
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Jeff" wrote:

> Hey
> asp.net 2.0
> As far as I know it's possible to search the users registrered at a asp.ne
t
> 2.0 web portal using either username or e-mail.
> But what about the custom profile properties which can be configured in
> web.config? Can they be searched too? I guess it can by using foreach loop
> and test the contents on every user object.. but I thought maybe there was
a
> cleaner and faster way to do it...
> Lets say for example these are custom profile settings in web.config. any
> suggestion on how to search them? Lets say the search should return all
> users containing the phrase "Lets" in lastname? or all users of a specific
> gender?
> <profile enabled="true">
> <properties>
> <add name="FirstName" type="string"/>
> <add name="LastName" type="string"/>
> <add name="Gender" type="string"/>
> <add name="BirthDate" type="DateTime"/>
> </properties>
> </profile>
> Best Regards
>
>

newbie: inserting data into sql form writes only null values

Hi,

using VStudio 2005/sql server 2005

Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:

I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value

here's the code:using VStudio 2005/sql server 2005

Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:

I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value

here's the code:

<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />

<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>

"thersitz" <thersitz@.gmail.comwrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value
>
here's the code:
>
>


Hi there,

Use

ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using the
name given by FormField. The problem with your vode is that, textbox does not
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:

<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>

--
Milosz

"thersitz" wrote:

Quote:

Originally Posted by

using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
>
here's the code:
>
<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />
>
<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>
>
>
>
>
"thersitz" <thersitz@.gmail.comwrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,

using VStudio 2005/sql server 2005

Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:

I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value

here's the code:


>
>
>


Thanks Milosz, it worked.

I'm confused why the book had me use the FormParameter and FormFieldID --
but thanks for getting me past this point.

Take care.

"Milosz Skalecki [MCAD]" <mily242@.REMOVEITwp.plwrote in message
news:1206D448-EDF2-419B-9A48-D05F7B51FAAF@.microsoft.com...

Quote:

Originally Posted by

Hi there,
>
Use
>
ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using
the
name given by FormField. The problem with your vode is that, textbox does
not
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:
>
<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>
>
--
Milosz
>
>
"thersitz" wrote:
>

Quote:

Originally Posted by

> using VStudio 2005/sql server 2005
>>
>Have a simple web form that inserts the results in a table. It seems to
>write to the table, but not the values from the asp forms fields. It adds
>a
>new record and increments the id field by one -- but in all the other
>fields, it merely writes Null to the fields. He are some other points:
>>
>I am not inserting data into every field -- for test purposes I am only
>using 4 fields.
>The id field is NOT one of the fields on the asp form -- although it is
>the
>only field that actually writes a correct value
>>
>here's the code:
>>
> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
> Last name:
> <asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
> Address:
> <asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
> City:
> <asp:TextBox ID="City" runat="server"></asp:TextBox><br />
> Year created:
> <asp:DropDownList ID="YearCreated" runat="server">
> </asp:DropDownList><br />
>>
> <asp:Button ID="Save" runat="server" Text="Save" />
> </div>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString=
> "<%$ ConnectionStrings:WHCConnectionString %>"
> InsertCommand=
> "INSERT INTO
> [artsfestival] ([lastName], [firstName], [address], [city])
> VALUES
> (@.lastName, @.firstName, @.address, @.city)">
> <InsertParameters>
> <asp:FormParameter Name="lastName" Type="String"
> FormField="LastName" />
> <asp:FormParameter Name="firstName" Type="String"
> FormField="FirstName" />
> <asp:FormParameter Name="address" Type="String"
> FormField="Address" />
> <asp:FormParameter Name="city" Type="String"
> FormField="City" />
> </InsertParameters>
> </asp:SqlDataSource>
>>
>>
>>
>>
>"thersitz" <thersitz@.gmail.comwrote in message
>news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It
adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value
>
here's the code:
>
>


>>
>>
>>

newbie: Instance failure!

Hey

asp.net 2.0

When I run the code below I get the runtime error "Instance Failure"

public static ICollection getInbox()
{
ArrayList al = new ArrayList();
ConnectionStringSettings css =
ConfigurationManager.ConnectionStrings["aspnet_DB"];
SqlDataSource sds = new SqlDataSource(css.ConnectionString, "SELECT
UserName from aspnet_Users");
try
{
IEnumerable INames = sds.Select(DataSourceSelectArguments.Empty);
foreach (DataRowView row in INames)
{
al.Add(row["UserName"]);
}
}
catch (SqlException sqlException)
{
Debug.WriteLine(sqlException.Message.ToString());
}
sds.Dispose();
return al;
}

The error occur at this line:
"IEnumerable INames = sds.Select(DataSourceSelectArguments.Empty);"

Just in case, here is a copy of my web.config file:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
</appSettings>
<connectionStrings>
<add name="aspnet_DB" connectionString="Data
Source=.\\SQLEXPRESS;Integrated
Security=True;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User
Instance=true" />
</connectionStrings>
<system.web>
<roleManager enabled="true"/>
<authentication mode="Forms"/>
<compilation debug="true"/>
<profile enabled="true">
<properties>
<add name="Picture" type="System.Byte[]" />
<add name="PictureType" type="string" />
</properties>
</profile>
</system.web>
</configuration>

My gut feeling tells me it might be caused by the db connectionsting, but
I'm not sure... I'm trying to connect to the express database within the
project!

Any suggestions to what I should do to fix this?

Jeff"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:ueLDl0PnGHA.1444@.TK2MSFTNGP02.phx.gbl...
> Hey
>
> asp.net 2.0
>
> When I run the code below I get the runtime error "Instance Failure"
>
> public static ICollection getInbox()
> {
> ArrayList al = new ArrayList();
> ConnectionStringSettings css =
> ConfigurationManager.ConnectionStrings["aspnet_DB"];
> SqlDataSource sds = new SqlDataSource(css.ConnectionString, "SELECT
> UserName from aspnet_Users");
> try
> {
> IEnumerable INames = sds.Select(DataSourceSelectArguments.Empty);
> foreach (DataRowView row in INames)
> {
> al.Add(row["UserName"]);
> }
> }
> catch (SqlException sqlException)
> {
> Debug.WriteLine(sqlException.Message.ToString());
> }
> sds.Dispose();
> return al;
> }
>
> The error occur at this line:
> "IEnumerable INames = sds.Select(DataSourceSelectArguments.Empty);"
>
> Just in case, here is a copy of my web.config file:
> <?xml version="1.0"?>
> <configuration
> xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
> <appSettings>
> </appSettings>
> <connectionStrings>
> <add name="aspnet_DB" connectionString="Data
> Source=.\\SQLEXPRESS;Integrated
> Security=True;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User
> Instance=true" />
> </connectionStrings>
> <system.web>
> <roleManager enabled="true"/>
> <authentication mode="Forms"/>
> <compilation debug="true"/>
> <profile enabled="true">
> <properties>
> <add name="Picture" type="System.Byte[]" />
> <add name="PictureType" type="string" />
> </properties>
> </profile>
> </system.web>
> </configuration>
>
> My gut feeling tells me it might be caused by the db connectionsting, but
> I'm not sure... I'm trying to connect to the express database within the
> project!
>
> Any suggestions to what I should do to fix this?
>
> Jeff
>

newbie: installing visual web developer express 2005

Hey
When installing visual web developer 2005, the installation suggest
installing on C: But I want to install it on D:, because I only got 1.6 GB
available on C: and D has 30 GB available...
So I change installation location from C:\Program Files\Microsoft Visual
Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
But even if I change to D: the installation says it will install 1.8 GB on
C: and 78 MB on D: (When C: is selected, it install everything on C:, all
the 1.8GB)
Is it possible to install everything on D: or do have to delete files from
my C: to make space for visual web developer 2005 express? This is on a
winxp pro system. I want to have atleast 1GB free space on C: for swap files
etc (maybe I should change the swap file to d:)
any suggestions?
JeffHi Jeff,
The .NET Framework, on which VWDE relies, wants to be installed on the
system drive, which is probably C:.
You could move your swap file to D: and might even see a performance gain.
Ken
Microsoft MVP [ASP.NET]
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest
> installing on C: But I want to install it on D:, because I only got 1.6 GB
> available on C: and D has 30 GB available...
> So I change installation location from C:\Program Files\Microsoft Visual
> Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on
> C: and 78 MB on D: (When C: is selected, it install everything on C:, all
> the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from
> my C: to make space for visual web developer 2005 express? This is on a
> winxp pro system. I want to have atleast 1GB free space on C: for swap
> files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
>
Hi, Jeff.
VS 2005 requires a lot of available space in the system drive,
although there's a lot of it you can install on a data drive.
The choice is available at setup time.
If you have 30GB free on D: and only 1.6 GB free on C:, what I'd suggest
is that you install WinXP Pro on D: and make D: your system drive.
You can then not have to worry about free system drive space, and you can ea
sily
install VWD Express and SQL Server 2005 Express on your new system drive ( D
: ).
You will breathe a lot easier after you do that.
Then, you could wipe clean your C: drive and place your swap file in it.
Sometimes, a clean break is a much better choice.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest instal
ling on C: But I want to
> install it on D:, because I only got 1.6 GB available on C: and D has 30 G
B available...
> So I change installation location from C:\Program Files\Microsoft Visual S
tudio 8\ -> D:\Program
> Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on
C: and 78 MB on D:
> (When C: is selected, it install everything on C:, all the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from
my C: to make space for
> visual web developer 2005 express? This is on a winxp pro system. I want t
o have atleast 1GB free
> space on C: for swap files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
>
Thanks, I've installed VWDE now... and yes I've noticed a performance
increase on my computer after moving my pagefile to D:
"Ken Cox [Microsoft MVP]" <BANSPAMkjopc@.newsgroups.nospam> wrote in message
news:%23559F4SmGHA.4212@.TK2MSFTNGP03.phx.gbl...
> Hi Jeff,
> The .NET Framework, on which VWDE relies, wants to be installed on the
> system drive, which is probably C:.
> You could move your swap file to D: and might even see a performance gain.
> Ken
> Microsoft MVP [ASP.NET]
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
>

newbie: installing visual web developer express 2005

Hey

When installing visual web developer 2005, the installation suggest
installing on C: But I want to install it on D:, because I only got 1.6 GB
available on C: and D has 30 GB available...

So I change installation location from C:\Program Files\Microsoft Visual
Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...

But even if I change to D: the installation says it will install 1.8 GB on
C: and 78 MB on D: (When C: is selected, it install everything on C:, all
the 1.8GB)

Is it possible to install everything on D: or do have to delete files from
my C: to make space for visual web developer 2005 express? This is on a
winxp pro system. I want to have atleast 1GB free space on C: for swap files
etc (maybe I should change the swap file to d:)

any suggestions?

JeffHi Jeff,

The .NET Framework, on which VWDE relies, wants to be installed on the
system drive, which is probably C:.

You could move your swap file to D: and might even see a performance gain.

Ken
Microsoft MVP [ASP.NET]

"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest
> installing on C: But I want to install it on D:, because I only got 1.6 GB
> available on C: and D has 30 GB available...
> So I change installation location from C:\Program Files\Microsoft Visual
> Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on
> C: and 78 MB on D: (When C: is selected, it install everything on C:, all
> the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from
> my C: to make space for visual web developer 2005 express? This is on a
> winxp pro system. I want to have atleast 1GB free space on C: for swap
> files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
Hi, Jeff.

VS 2005 requires a lot of available space in the system drive,
although there's a lot of it you can install on a data drive.

The choice is available at setup time.

If you have 30GB free on D: and only 1.6 GB free on C:, what I'd suggest
is that you install WinXP Pro on D: and make D: your system drive.

You can then not have to worry about free system drive space, and you can easily
install VWD Express and SQL Server 2005 Express on your new system drive ( D: ).

You will breathe a lot easier after you do that.
Then, you could wipe clean your C: drive and place your swap file in it.

Sometimes, a clean break is a much better choice.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest installing on C: But I want to
> install it on D:, because I only got 1.6 GB available on C: and D has 30 GB available...
> So I change installation location from C:\Program Files\Microsoft Visual Studio 8\ -> D:\Program
> Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on C: and 78 MB on D:
> (When C: is selected, it install everything on C:, all the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from my C: to make space for
> visual web developer 2005 express? This is on a winxp pro system. I want to have atleast 1GB free
> space on C: for swap files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
Thanks, I've installed VWDE now... and yes I've noticed a performance
increase on my computer after moving my pagefile to D:

"Ken Cox [Microsoft MVP]" <BANSPAMkjopc@.newsgroups.nospam> wrote in message
news:%23559F4SmGHA.4212@.TK2MSFTNGP03.phx.gbl...
> Hi Jeff,
> The .NET Framework, on which VWDE relies, wants to be installed on the
> system drive, which is probably C:.
> You could move your swap file to D: and might even see a performance gain.
> Ken
> Microsoft MVP [ASP.NET]
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
>> Hey
>>
>> When installing visual web developer 2005, the installation suggest
>> installing on C: But I want to install it on D:, because I only got 1.6
>> GB available on C: and D has 30 GB available...
>>
>> So I change installation location from C:\Program Files\Microsoft Visual
>> Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
>>
>> But even if I change to D: the installation says it will install 1.8 GB
>> on C: and 78 MB on D: (When C: is selected, it install everything on C:,
>> all the 1.8GB)
>>
>> Is it possible to install everything on D: or do have to delete files
>> from my C: to make space for visual web developer 2005 express? This is
>> on a winxp pro system. I want to have atleast 1GB free space on C: for
>> swap files etc (maybe I should change the swap file to d:)
>>
>> any suggestions?
>>
>> Jeff
>>