Saturday, March 31, 2012

Where did Request("email") go?

I have a 2-page site. The first page default.aspx contains 2 Webform fields: Email and Zipcode. These 2 fields are validated using the built-in validation. When successful, I just want the 2 values to appear in the second page (default2.aspx) in 2 new textboxes. Request("email") and Request("zipcode") won't do it. Is it much more complicated in asp.net? Please help.Request("email") is looking for a form element or querystring variable.
How are you going from Page1 to Page2, is there a form submitted?
Yes there is a form in the first page. In the submit button .Click, I programmed it to do a Response.Redirect to default2.aspx.
then you must redirect to default2.aspx?email=xxxx, etc., because your Redirect is causing the form NOT to be submitted.

(or change the form submit to regular html submit button, and not a server control)
Thanks! It works! Here's my revised redirect string:

Response.Redirect("default2.aspx?Email=" & email.Text)

I just thought that there was a new way of passing parameters in asp.net ("postback"?).
Is there a Webform element equivalent to the traditional hidden form field? I want to store the values from the first page. Default2.aspx is also a form that will submit values from the first page (like Step one, Step two style online forms).
use a textbox control
set Visible=False
Why are you passing values to a second page.. that defeats the whole point of viewstate. what you are actually doing is submitting the form, thus creating a new request to the server... and then you are redirecting, which is also another request to the server. Why? Why not just use the same page to do the processing on the form's elements.
Thanks for the replies.

I need a second page because the creative on the first page is a simple "zipcode" only promotion. The creative on the first page is different than on the second page. When a user enters a zipcode, an affiliate gets paid.

The second page is a also a form that when filled out by the user, the affiliate also gets paid but at a much lower rate because there are more fields to fill out. The creative on this page is different in an attempt to lure the user to fill it out.

Therefore, since these are 2 different looking pages, it's more practical to create 2 pages especially when working alongside a web designer.

Where did my webpage go?

I've got some typical friday afternoon issue.

When I visit/debug a webpage (which worked before), I get a blanc page.

When I view the source in the browser, al the code has rendered and it looks ok.

I tested, with some static text just after the <form> tag, but the text is not show either.

What is wrong?

weird error -- asp.net might have lost its mappings

if you just type in "test" on default.aspx with nothing else does it show up?

might need to register asp again


I commented out a lot of code and found that the external javascript file is causing the problem.

So I commented out all javascript code in the file. But the problem still exists.

<

headrunat="server"><title>My Title</title><linkhref="css/main.css"rel="stylesheet"type="text/css"/><scriptsrc="parameter_overview.js"/>

</

head>

I tried all kind of things, changing the src (url), adding the "type" attribuut, adding the "language" attribute.
Problem keeps existing.

What goes wrong or what could I test?


I found the problem!!!

You have to use a closing tag, and can not use the < /> shortcut.

<scriptsrc="parameter_overview.js"type="text/javascript"></script> = OK<scriptsrc="parameter_overview.js"type="text/javascript" /> = NOT OK

Where did the Build Comment Web Pages too go?

In VS 2003 there was a menu item 'Tools' -- > 'Build Comment Web Pages'. Is
that function in VS 2005? I haven't been able to find it, nor is it in
Help.
Thanks!
VelvetHi Velvet,
Thank you for posting.
As for the "Build Comment Web Pages" function, it does be one of the items
that was removed from VS 2003 to VS 2005. Actually, the original one in VS
2003 is a simple document generation helper while there has many 3rd party
document generation component like NDoc can provide sophisticated doc
generation and integrated with vs ide. And currently the NDoc is also
planning a new version to support .NET 2.0, you can search the NDOC's space
to get more info.
BTW, as for VS 2005, it provide a simple Automation sample add-in which can
help generate comment pages, you can also have a look at it to see whether
it helps:
#Visual Studio .NET: Automation Samples
http://www.microsoft.com/downloads/...9710-6DF7-4F3F-
A5AE-425A478DDEEB&displaylang=en&displaylang=en
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Where did the Build Comment Web Pages too go?

In VS 2003 there was a menu item 'Tools' -- > 'Build Comment Web Pages'. Is
that function in VS 2005? I haven't been able to find it, nor is it in
Help.

Thanks!
VelvetHi Velvet,

Thank you for posting.

As for the "Build Comment Web Pages" function, it does be one of the items
that was removed from VS 2003 to VS 2005. Actually, the original one in VS
2003 is a simple document generation helper while there has many 3rd party
document generation component like NDoc can provide sophisticated doc
generation and integrated with vs ide. And currently the NDoc is also
planning a new version to support .NET 2.0, you can search the NDOC's space
to get more info.

BTW, as for VS 2005, it provide a simple Automation sample add-in which can
help generate comment pages, you can also have a look at it to see whether
it helps:

#Visual Studio .NET: Automation Samples
http://www.microsoft.com/downloads/...9710-6DF7-4F3F-
A5AE-425A478DDEEB&displaylang=en&displaylang=en

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

where did they come from?

Hi..is there a way to tell where users came from in a
particular page in asp.net? how do i know what page(web
form, within my site) are they coming from without
abusing querystrings? i would greatly appreciate any help.Try
Request.UrlReferrer

"ska4reak" <ska4reak@.yahoo.com> wrote in message
news:0b6301c3aaca$6ab13560$a501280a@.phx.gbl...
> Hi..is there a way to tell where users came from in a
> particular page in asp.net? how do i know what page(web
> form, within my site) are they coming from without
> abusing querystrings? i would greatly appreciate any help.

where did the methods for a component go

Hello,
Using VWD 2005 here... I have a GridView and for usability, the edit
template for one of the columns was changed from the defaut to a
calendar control.
Also, I have some content which I want to add to the calendar...
something akin to this MSDN example...
http://www.asp.net/QuickStart/util/...r/Calendar5.src
On the code behind page, where the class and method name comboboxes
are, the calendar and it's methods isn't there! What happened to the
component and its methods? To put custom content in the calendar, like
the example, the DayRender method is needed.
Suggestions are greatly appreciated.
Thanks!Hi all,
A w ago, I tried something like this to get access to a calendar's
methods which are part of the edit item template in my gridview:
Dim WithEvents myCalendar As New Calendar
Protected Sub GridView1_RowDataBound(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
myCalendar =
Me.GridView1.Rows(myRow).FindControl("Calendar1")
AddHandler calView.DayRender, AddressOf
calView_DayRender
End If
End Sub
This fails miserably with a null reference exception. I'm as
to why it's looking for the new keyword here... is that for the event
handler then?
So after some more reading, I tried this...
'
'
'
Protected Sub GridView1_Load(ByVal sender As Object, ByVal e
As System.EventArgs) Handles
GridView1.Load
Dim editField As New TemplateField
editField.EditItemTemplate = New
CompiledBindableTemplateBuilder(AddressO
f buildCalendar, Nothing)
GridView1.Columns.Insert(3, editField)
End Sub
'
'
'
Sub buildCalendar(ByVal ctl As Control)
Dim ipa As IParserAccessor = ctl
Dim cal As Calendar = New Calendar
cal.TemplateControl = Me
cal.ID = "editCalendar"
AddHandler cal.DayRender, AddressOf renderCalendar
ipa.AddParsedSubObject(cal)
End Sub
'
'
'
Sub renderCalendar(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs)
Dim myCal As Calendar = CType(sender, Calendar)
myCal.ID = "editCalendar"
'
' stuff which follows would be for the calendar cell
background color and text rendering one can do in
' DayRender...
'
End Sub
This solution does indeed make an edit item template with a calendar as
the component... but there are two problems...
1. I want the edit item to be a part of column 3. But what this thing
does is create a totally new column at runtime, inserts it, and shifts
the other columns one index to the right.
2. When a user clicks a day an additional, blank, column is added to
the grid.
Can anyone help with the 2 problems I still have? Thanks!

where did the methods for a component go

Hello,

Using VWD 2005 here... I have a GridView and for usability, the edit
template for one of the columns was changed from the defaut to a
calendar control.

Also, I have some content which I want to add to the calendar...
something akin to this MSDN example...
http://www.asp.net/QuickStart/util/...r/Calendar5.src

On the code behind page, where the class and method name comboboxes
are, the calendar and it's methods isn't there! What happened to the
component and its methods? To put custom content in the calendar, like
the example, the DayRender method is needed.

Suggestions are greatly appreciated.

Thanks!Hi all,

A week ago, I tried something like this to get access to a calendar's
methods which are part of the edit item template in my gridview:

Dim WithEvents myCalendar As New Calendar

Protected Sub GridView1_RowDataBound(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView1.RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then
myCalendar =
Me.GridView1.Rows(myRow).FindControl("Calendar1")
AddHandler calView.DayRender, AddressOf
calView_DayRender
End If

End Sub

This fails miserably with a null reference exception. I'm confused as
to why it's looking for the new keyword here... is that for the event
handler then?

So after some more reading, I tried this...

'
'
'
Protected Sub GridView1_Load(ByVal sender As Object, ByVal e
As System.EventArgs) Handles
GridView1.Load
Dim editField As New TemplateField
editField.EditItemTemplate = New
CompiledBindableTemplateBuilder(AddressOf buildCalendar, Nothing)
GridView1.Columns.Insert(3, editField)
End Sub

'
'
'
Sub buildCalendar(ByVal ctl As Control)
Dim ipa As IParserAccessor = ctl
Dim cal As Calendar = New Calendar
cal.TemplateControl = Me
cal.ID = "editCalendar"
AddHandler cal.DayRender, AddressOf renderCalendar
ipa.AddParsedSubObject(cal)
End Sub

'
'
'
Sub renderCalendar(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs)

Dim myCal As Calendar = CType(sender, Calendar)
myCal.ID = "editCalendar"

'
' stuff which follows would be for the calendar cell
background color and text rendering one can do in
' DayRender...
'
End Sub

This solution does indeed make an edit item template with a calendar as
the component... but there are two problems...

1. I want the edit item to be a part of column 3. But what this thing
does is create a totally new column at runtime, inserts it, and shifts
the other columns one index to the right.

2. When a user clicks a day an additional, blank, column is added to
the grid.

Can anyone help with the 2 problems I still have? Thanks!

Where do global variables go in ASP dot net?

I have just started in ASP.NET. I did ASP years ago but have
forgotten most of it.

As I remember in the old ASP, you put global variable in the
global.asa file. But my question is on ASP.NET. I would think global
variables would go in global.asax, but that doesn't seem to work.

Let me make sure I am even using the correct termonology. I just have
one web form, but it resets the variables every time it is reloaded,
and I want a place to store variables that I do not want reset when
the form is reloaded. I think of those as global variables, but maybe
that is the wrong term.

Hello tomcarr,

asp.net is OO language based, so you could declare a public static member for the Global class as an equivalent to the global vars approach. Here is a sample:

' Global.asax.vb
Public Class Global
Inherits System.Web.HttpApplication

Public Shared MyGlobalInteger As Integer = -1

' ...
End Class

' Any page
Dim MyInt As Integer = Global.MyGlobalInteger

Anyway i'd suggest you look into documentation for the various asp.net options for storing state, like the Application (application scope), Session (session scope), and ViewState (page scope) objects.

Regards. -LV


Thanks for you help LV.

I am reading about application state and session state as yousuggested. One thing I am not clear on. I can create asession state variable in code just by doing:

Session("Message") = "MyMsg"

But is there some way I can define the variable as a string or integer or whatever doing it this way?

.

> I can create a session state variable in code just by doing: Session("Message") = "MyMsg"
> But is there some way I can define the variable as a string or integer or whatever doing it this way?

I'm afraid not. The Session store (as Application and ViewState) holds generic objects. So you can assign to it whatever object reference or value type (the latter gets "boxed"...), and just remember to cast to the proper type when retrieveing the value (anyway the compiler throws an error if you don't cast and have option stric on).

In instance:

Session("MyInteger") = -1
Session("MyString") = "Test"
Session("MyObject") = New MyCustObject()

Dim MyInt As Integer = CInt(Session("MyInteger"))
Dim MyStr As String = CStr(Session("MyString"))
Dim MyObj As MyCustObject = CType(Session("MyObject"), MyCustObject)

Regards. -LV

Where do assemblies go in ASP.Net 2.0

Ok. Im new to VS.net 2005. In previous versions, I was accustomed to seeing a bin folder in my web application that would contain all assemblies necessary to run my web site.

I dont see this folder being created. Can anyone tell me what happens to assemblies when you build an ASP.Net 2.0 web site in VS.Net?

Thanks!

Its been my experience so far that when you Publish your site, a /bin folder is created with the appropriate .dll in it. I have also started to create my own /bin directory for my projects and each time I Build, Visual Studio seems to update the .dll there (could be my imagination).

By default, the new framework compiles files on a page by page basis

on the first load, OR if you use the precompile option under the "publish" menu, the page's given partial class is compiled into a file and placed in the /bin/ directory as mentioned above

If you want the old "single dll" option, you need to install the Web Applications Projects add on, but keep in mind that the new way allows you to change one page (and more important, the page's code behind) without affecting any other page in the application.....

Scott Guthrie's blog in an excellent source on Web Application Projects
http://weblogs.asp.net/scottgu

where Dll file

i maked web application by Visual Web Developer 2005 Express Edition and whene i build Web App. never make any dll

in Web folder i get 3 files .aspx,.xml and.vb

any one can help me to make dll

thanx

Is there a /bin folder in the app folder? (haven't played with VWD in a while so I can't remember for certain)
By default, DLL files aren't created. It uses the code in the App_Code folder. You have to manually specify that you want your web application project to generate a DLL file.
In 2005 all the compilation is handled by ASP.NET and not the IDE. This allows more of a scripting ability where the entire application does not have to be rebuilt everytime one code-behind is changed. Each page compiles into their own dlls. The app_code directory compiles into it's own dll...etc.

where do I d/l latest framework?

i have: Microsoft .NET Framework Version:2.0.50215.44
where can I download the lastest framework,notVWD- justthe framework

The above build number is the Beta2 version that shipped this spring. The final release will be available for download the week of November 7th -- so you might want to hold off until then to download and install anything new (since it is now pretty close).
Hope this helps,
Scott


i'm holding my breath

Where do I create Session Related in ASP.NET 2.0

hI,
Where do I created the Session Related things in ASP.NET 2.0?
How do I do that?
Could anybody give some sample code?
bye
ssss <ss@.discussions.microsoft.com>'s wild thoughts were
released on Thu, 4 May 2006 21:13:01 -0700 bearing the
following fruit:

>hI,
>
>Where do I created the Session Related things in ASP.NET 2.0?
>How do I do that?
>Could anybody give some sample code?
>
Which 'session related things' are you refering to?
A little more information would go a long way.
J
Jan Hyde (VB MVP)
Two Aerials met on a roof, fell in love & got married. The ceremony was rubb
ish but the reception was brilliant.
hi,
which 'session related things' are you refering to means, user session
related things
bye
ss
"Jan Hyde" wrote:

> ss <ss@.discussions.microsoft.com>'s wild thoughts were
> released on Thu, 4 May 2006 21:13:01 -0700 bearing the
> following fruit:
>
> Which 'session related things' are you refering to?
> A little more information would go a long way.
> J
> Jan Hyde (VB MVP)
> --
> Two Aerials met on a roof, fell in love & got married. The ceremony was ru
bbish but the reception was brilliant.
>
Well at least its all clear now. ;)
ss, what I think Jan is asking, is, what are you wanting to do? Session
related things is a little broad. Its a little pointless to try and
guess what you are wanting to do, so if you could explain a little
further it would help a lot.
Regards
Ray
ss wrote:
> hi,
> which 'session related things' are you refering to means, user session
> related things
> bye
> ss
> "Jan Hyde" wrote:
>

Where do I create Session Related in ASP.NET 2.0

hI,

Where do I created the Session Related things in ASP.NET 2.0?

How do I do that?

Could anybody give some sample code?

bye
ssss <ss@.discussions.microsoft.com>'s wild thoughts were
released on Thu, 4 May 2006 21:13:01 -0700 bearing the
following fruit:

>hI,
>
>Where do I created the Session Related things in ASP.NET 2.0?
>How do I do that?
>Could anybody give some sample code?

Which 'session related things' are you refering to?

A little more information would go a long way.

J

Jan Hyde (VB MVP)

--
Two Aerials met on a roof, fell in love & got married. The ceremony was rubbish but the reception was brilliant.
hi,

which 'session related things' are you refering to means, user session
related things

bye
ss

"Jan Hyde" wrote:

> ss <ss@.discussions.microsoft.com>'s wild thoughts were
> released on Thu, 4 May 2006 21:13:01 -0700 bearing the
> following fruit:
> >hI,
> >Where do I created the Session Related things in ASP.NET 2.0?
> >How do I do that?
> >Could anybody give some sample code?
> Which 'session related things' are you refering to?
> A little more information would go a long way.
> J
> Jan Hyde (VB MVP)
> --
> Two Aerials met on a roof, fell in love & got married. The ceremony was rubbish but the reception was brilliant.
>
Well at least its all clear now. ;)

ss, what I think Jan is asking, is, what are you wanting to do? Session
related things is a little broad. Its a little pointless to try and
guess what you are wanting to do, so if you could explain a little
further it would help a lot.

Regards
Ray

ss wrote:
> hi,
> which 'session related things' are you refering to means, user session
> related things
> bye
> ss
> "Jan Hyde" wrote:
>> ss <ss@.discussions.microsoft.com>'s wild thoughts were
>> released on Thu, 4 May 2006 21:13:01 -0700 bearing the
>> following fruit:
>>
>>> hI,
>>>
>>>
>>> Where do I created the Session Related things in ASP.NET 2.0?
>>>
>>> How do I do that?
>>>
>>> Could anybody give some sample code?
>>>
>> Which 'session related things' are you refering to?
>>
>> A little more information would go a long way.
>>
>> J
>>
>> Jan Hyde (VB MVP)
>>
>> --
>> Two Aerials met on a roof, fell in love & got married. The ceremony was rubbish but the reception was brilliant.
>>
>>

where do I begin?

I am totally new to dot net development.
I have a dot.net site that I need to setup on one of my servers.

I have no documentation associated with the site.
It is not a complicated site.
A small shopping cart with an access db backend.

Can someone give me a checklist of what I need to install to get this up and running?

Any hints, tips - things to be aware of... Anything to help me get this up and running...

Thank you in advance...You will need to install on the server:

1.0 or 1.1 .NET Framework (whichever the application is using)
Copy your files and database over to your server
Configure IIS with a virtual directory and set it to that directory

Not much else.
thank you for the reply.
I am halfway there..

I have the web site setup, and I can go to the site. The files I am going to is an aspx file.
it is reading the file - with no noticeable errors. But the contents from the database is not being displayed. But no errors that I can see..

Can I assume that dot.net is installed? If not how can I find out if it is?

Thank you
Hello, try to put this in the body of ur aspx page:
<% Response.Write(DateTime.Now); %>
This way, you will print today's date, if it printed well, then .net framework is installed.

Reply to us to know how to help you more.

good Luck.
hello,
no - it did not work
I am trying to install the dot.net but having a problem doing so...

--------
Microsoft .NET Framework Setup
--------
Microsoft .NET Framework Setup failed. If this problem continues, contact Product Support Services.
--------
OK
--------

Any clue?
Hello, you need to get.NET Framework 1.1, make sure you have no other versions of th e.net on ur pc.
Then, try to install the .netframework.

Do this and reply to me.

Regards.
Squeakita,
You can find a bunch of what you are looking for at
www.TechnicalVideos.net.
Ok - downloaded and install attempted. It still failed.
I checked to see if a previous version was installed. - no othere versions installed.

I did a system update prior to the install to make sure I was up todate.

I am getting 2 error message in the event log

#1
Windows Installer proxy information not correctly registered

#2
Failed to connect to server. Error: 0x80004005

BTW it's a Windows 2000 with service pack 4

I am at a loss right now.
If the page appears, then the Framework is installed. If the data is not there, then you have a code problem. Try enabling the Trace in the web.config file to see if it tells you any information like unhandled exceptions you might not see on the page itself.
I found this ...

Application Event 1014 against MsiInstaller, Windows Installer proxy information not correctly registered.

Application Event 1015 against MsiInstaller, failed to connect to server. Error 0x80070424.

In this case, re-registering the Windows Installer component should fix the problem. After re-registering Windows Installer, attempt to reinstall the Advanced Client.

To re-register Windows Installer:

#1 Unregister Windows Installer first, by typing the following in a CMD window and hitting the Enter key:

msiexec /unreg

#2 Next, in the same CMD window, re-register Windows Installer by typing the following and hitting the Enter key:

msiexec /regserver

I did it and now...it is installing

Where do I begin?

I am a small business owner with a web sites that, if boiled down to its core, is a small on-line niche bookstore with things like a newsletter, discussion forums, and a couple of searchable databases thrown in. I have four computers:

1) Web server running Microsoft Server 2000
2) Personal, daily use laptop running XP Home Edition
3) Desktop, daily use running XP Home Edition
4) Desktop, workhorse running Windows 98 (because my bookkeeping program requires that)

My web site is programmed in ASP using Visual Basic. I want to take things to the next level. I "think" I should be learning ASP.NET. I've purchased several books, downloaded the ASP.NET web matrix, spent an entire week trying to figure it out and find myself hitting a huge brick wall that I cannot seem to penetrate.

It appears I need some new software, but I simply cannot figure out what to get. I have looked at purchasing the Microsoft Action Pack, but it doesn't come with Visual Studio .NET (that I can't afford to purchase separately). The books I've purchased re .NET all refer to Visual Studio .NET. This web site seems to indicate that isn't needed if you use the ASP.NET web matrix, but I can't figure out what the difference is (except that any example I try to replicate from my books DON'T WORK in the ASP.NET web matrix).

Can someone PLEASE just tell me what I need to actually write a snip of code, ("Hello World" would be GREAT), and actually have it run. I'm completely overwhelmed with all of the options. I'm looking for a "start at the very beginning," "do A, B, C and you'll be off and running" in plain English answer.You might find it worthwhile to follow the tutorials atLearnASP.com (particularly the "First Lessons" section in the menu on the left). Charles seems to have a knack for bringing in the uninitiated and getting them on the right track.

Where do I download VS Studio 2005 ?

Hi all,
Where can I download the trial version of VS Studio 2005 ?
Many thanks,
IL2FTry :
http://msdn.microsoft.com/vstudio/products/trial/
Patrice
"omvinh@.tma.com.vn" <omvinh@.tma.com.vn@.discussions.microsoft.com> a crit
dans le message de news:
697ED9C7-DA87-4B77-9CA7-EF242CC46C47@.microsoft.com...
> Hi all,
> Where can I download the trial version of VS Studio 2005 ?
> Many thanks,
> IL2F
"omvinh@.tma.com.vn" wrote ...

> Hi all,
> Where can I download the trial version of VS Studio 2005 ?
http://msdn.microsoft.com/vstudio/
There's a link on the right to "Try Now"
Regards
Rob
Se my answer in the microsoft.public.dotnet.academic group.
omvinh@.tma.com.vn wrote:
> Hi all,
> Where can I download the trial version of VS Studio 2005 ?
> Many thanks,
> IL2F

Where do I download VS Studio 2005 ?

Hi all,
Where can I download the trial version of VS Studio 2005 ?

Many thanks,
IL2FSe my answer in the microsoft.public.dotnet.academic group.

omvinh@.tma.com.vn wrote:
> Hi all,
> Where can I download the trial version of VS Studio 2005 ?
> Many thanks,
> IL2F

Where do I find machine.config?

Hi I have been searching for my machine.config file and cannot find it. Where is it usually based.

ThanksTry:
C:\WinNT\Microsoft.Net\Framework\v1.1.4322\Config

Where do I find INTRO.CSS and other files

In the tutorials, I downloaded several sample code files like INTRO6.ASPX. However, these files refer to other files like INTRO.CSS and XML files. Where do I get those files from?

Thanks.i need intro.css plz send immediate reply plz do the needfull with oblige
Hi,

The intro.css is a StyleSheet for the sample to run, and you can find out the path from the source of the Tutorial, and then manually replace the current file name in the URL with the stated path.

Regards,
As Colt said - look in the source of Intro6.aspx - it will give you the page to the CSS file in the link to it...go to that directory and you will find the files.

Anywhere a file is referred to in code, it must be referred to by it's path.
Follow the path - find the file
I realize this is an old thread, but it seems that the intro.css is the only file left out. There is no posted source. I am new to this but I am not opposed to creating a new one from scratch. Is there a tutorial that covers the css file or files like it? So far everything has been working with exception that my background color is different. Is that all the intro.css is used for? It appears the tutorial is for people not so green as me, but I seem to be making progress just the same.
Thanks for the great tutorials!
Don

1. Open the example page in IE:

http://atlas.asp.net/quickstart/atlas/samples/controls/control5.aspx

2. Navigate to the local browser cache in Windows Explorer:

C:\Documents and Settings\username\Local Settings\Temporary Internet Files\intro.css

How this helpsSmile [:)]

where do i find visual sourcesafe?

I'm using Visual Studio, with ASP.NET. Is VSS on a separate CD.

Also, is it possible to use the VSS beta (2005) with .NET if I'm not using
the .NET beta.
And finally, where do I get the VSS beta... when I go to msdn, it just
directs me to a page with Whidbey downloads... nothing mentioned on VSS

TY
Jason ShohetVSS comes on a separate CD for VS.Net Ent Architect and Ent Developer
only...not for any other verison...you can buy it separetly though:
http://msdn.microsoft.com/howtobuy/vss/default.aspx

In beta, VSS is dead...instead the new Visual Studio Team System has a new
source control core..not sure what they are calling it. VS TS is only
available to MSDN subscribers at this point...and I doubt you could use it
with VS.Net 2003 since its no longer a stand-alone product.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Jason Shohet" <__ash477@.yahoo.com> wrote in message
news:ODIu8yt4EHA.828@.TK2MSFTNGP14.phx.gbl...
> I'm using Visual Studio, with ASP.NET. Is VSS on a separate CD.
> Also, is it possible to use the VSS beta (2005) with .NET if I'm not using
> the .NET beta.
> And finally, where do I get the VSS beta... when I go to msdn, it just
> directs me to a page with Whidbey downloads... nothing mentioned on VSS
> TY
> Jason Shohet
Thanks I have enterprise architect. How to install VSS... does part of it
go on the developers' machines, and part on the development server (ie 1
central server where we check in & check out) ?

TY
Yes...there's a client setup and a server setup...don't remember the
details...should be pretty clear once you put the cd in...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Jason Shohet" <__ash477@.yahoo.com> wrote in message
news:%23OhXTUu4EHA.4092@.TK2MSFTNGP14.phx.gbl...
> Thanks I have enterprise architect. How to install VSS... does part of
it
> go on the developers' machines, and part on the development server (ie 1
> central server where we check in & check out) ?
> TY
re:
> In beta, VSS is dead...

I wouldn't call VSS "dead".
VSS 2005 is coming, which will work with VS 2005.

See
http://msdn.microsoft.com/library/d...html/vssmap.asp

"To coincide with the release of Visual Studio 2005, Microsoft will offer
Visual SourceSafe 2005, a more highly refined and integrated version
control system that adds new and expanded capabilities for teams
and individuals. "

"Following minor changes in Visual SourceSafe 6.0d (released with
Visual Studio .NET 2003), Microsoft is making more enhancements
for Visual SourceSafe 2005."

"These fundamental changes will improve the reliability, scalability,
performance, and remote access capabilities of Visual SourceSafe."

VSS looks to be quite alive!

:-)

For an overview of Visual Studio Team System, see :
http://msdn.microsoft.com/library/d...l/vsts-over.asp

Juan T. Llibre
===========

"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:O9VW%239t4EHA.2540@.TK2MSFTNGP09.phx.gbl...
> VSS comes on a separate CD for VS.Net Ent Architect and Ent Developer
> only...not for any other verison...you can buy it separetly though:
> http://msdn.microsoft.com/howtobuy/vss/default.aspx
> In beta, VSS is dead...instead the new Visual Studio Team System has a new
> source control core..not sure what they are calling it. VS TS is only
> available to MSDN subscribers at this point...and I doubt you could use it
> with VS.Net 2003 since its no longer a stand-alone product.
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "Jason Shohet" <__ash477@.yahoo.com> wrote in message
> news:ODIu8yt4EHA.828@.TK2MSFTNGP14.phx.gbl...
>> I'm using Visual Studio, with ASP.NET. Is VSS on a separate CD.
>>
>> Also, is it possible to use the VSS beta (2005) with .NET if I'm not
>> using
>> the .NET beta.
>> And finally, where do I get the VSS beta... when I go to msdn, it just
>> directs me to a page with Whidbey downloads... nothing mentioned on VSS
>>
>> TY
>> Jason Shohet
>>
>>

Where do I find wsdl.exe?

Hi,

Where do I find, or where can I get a copy of wsdl.exe?

Thanks

JBwsdl.exe is a part of SDK tools - installing SDK should get you all the tools.

Hope that helps
Kashif
Hi Kashif,

I found it right where you said it would be.

Thanks,

JB

where do i find visual sourcesafe?

I'm using Visual Studio, with ASP.NET. Is VSS on a separate CD.
Also, is it possible to use the VSS beta (2005) with .NET if I'm not using
the .NET beta.
And finally, where do I get the VSS beta... when I go to msdn, it just
directs me to a page with Whidbey downloads... nothing mentioned on VSS
TY
Jason ShohetVSS comes on a separate CD for VS.Net Ent Architect and Ent Developer
only...not for any other verison...you can buy it separetly though:
http://msdn.microsoft.com/howtobuy/vss/default.aspx
In beta, VSS is dead...instead the new Visual Studio Team System has a new
source control core..not sure what they are calling it. VS TS is only
available to MSDN subscribers at this point...and I doubt you could use it
with VS.Net 2003 since its no longer a stand-alone product.
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Jason Shohet" <__ash477@.yahoo.com> wrote in message
news:ODIu8yt4EHA.828@.TK2MSFTNGP14.phx.gbl...
> I'm using Visual Studio, with ASP.NET. Is VSS on a separate CD.
> Also, is it possible to use the VSS beta (2005) with .NET if I'm not using
> the .NET beta.
> And finally, where do I get the VSS beta... when I go to msdn, it just
> directs me to a page with Whidbey downloads... nothing mentioned on VSS
> TY
> Jason Shohet
>
Thanks I have enterprise architect. How to install VSS... does part of it
go on the developers' machines, and part on the development server (ie 1
central server where we check in & check out) ?
TY
Yes...there's a client setup and a server setup...don't remember the
details...should be pretty clear once you put the cd in...
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Jason Shohet" <__ash477@.yahoo.com> wrote in message
news:%23OhXTUu4EHA.4092@.TK2MSFTNGP14.phx.gbl...
> Thanks I have enterprise architect. How to install VSS... does part of
it
> go on the developers' machines, and part on the development server (ie 1
> central server where we check in & check out) ?
> TY
>
re:
> In beta, VSS is dead...
I wouldn't call VSS "dead".
VSS 2005 is coming, which will work with VS 2005.
See
http://msdn.microsoft.com/library/d...m
ap.asp
"To coincide with the release of Visual Studio 2005, Microsoft will offer
Visual SourceSafe 2005, a more highly refined and integrated version
control system that adds new and expanded capabilities for teams
and individuals. "
"Following minor changes in Visual SourceSafe 6.0d (released with
Visual Studio .NET 2003), Microsoft is making more enhancements
for Visual SourceSafe 2005."
"These fundamental changes will improve the reliability, scalability,
performance, and remote access capabilities of Visual SourceSafe."
VSS looks to be quite alive!
:-)
For an overview of Visual Studio Team System, see :
http://msdn.microsoft.com/library/d...r />
-over.asp
Juan T. Llibre
===========
"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:O9VW%239t4EHA.2540@.TK2MSFTNGP09.phx.gbl...
> VSS comes on a separate CD for VS.Net Ent Architect and Ent Developer
> only...not for any other verison...you can buy it separetly though:
> http://msdn.microsoft.com/howtobuy/vss/default.aspx
> In beta, VSS is dead...instead the new Visual Studio Team System has a new
> source control core..not sure what they are calling it. VS TS is only
> available to MSDN subscribers at this point...and I doubt you could use it
> with VS.Net 2003 since its no longer a stand-alone product.
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "Jason Shohet" <__ash477@.yahoo.com> wrote in message
> news:ODIu8yt4EHA.828@.TK2MSFTNGP14.phx.gbl...
>

Where do I go for my .Net questions for Windows apps?

Hi,

I've been writing C# and ASP.NET code for some time and I'm pretty comfortable with it. However, I recently wanted to write a Windows application using C# with a database backend and I was completely paralized. I didn't know where to start.

I keep my database connection string in Web.Config file for my ASP.NET apps. I didn't even know where to keep that for a Windows app.

Where do I go for my .NET questions pertaining to Windows applications?www.windowsforms.com

Where do I initialize?

I'm working on a UserControl ( ASP.NET 1.1, C#, VS 2003), where I can't
manage the state of multiple controls correctly.
The controls have the following constraints
1: It has two possible appearances: One 25px high ( InActiveState) with
just a summary & an 'Activate / DeActivate' button, or the complete (400px)
high (Active) control
2: Only one control can be active on a page at any given time.
My problem is that my logic doesn't work ( or, why else would I be posting
this).
I have a test container with 3+ controls on it. I activate the first
control just fine. When I activate the second control, it appears but the
first control doesn't de-activate. When I activate the third control, the
first two deactivate. I then activate one of the first two, and the third
doesn't deactivate. When I activate another, the two previously active
controls deactivate. I'm wondering if I should move some of the following
logic to the Page_Unload method, or to the Initialize or PreRender methods.
My existing logic is as follows:
I am handling this using Session Variables, all defined/modified in the
Page_Load or the btnActivate_DeActivate_Click methods of the MyControl
class.
I create a Session variable for each control: Session[ this.ClientId +
"_ActiveState" ] , = "1" for the active state, "0" otherwise,
and one session variable to indicate which control is active: Session[
"WhichControlIsActive" ] = this.ClientId
of the currently active control
In MyControl
Page_Load
{
if ( Session[this.ClientId + "_ActiveState"] == null ) Session[
this.ClientId + "_ActiveState"] = "0"; // Initialize null session
variable for active state to inactive
if ( Session[ "WhichControlIsActive" ] == null ) Session[
"WhichControlIsActive" ] == "None"; // Initialize null session
variable for active control to none
if ( (Session[this.ClientId + "_ActiveState"] == "0") || (
Session["WhichControlIsActive" ] != this.ClientId)) // this control is
inactive
{
SetHeight( this, 25);
this.btnActivateDeActivate.text = "Activate";
Session[this.ClientId + "_ActiveState] == "0" ;
}
if ( ( Session[this.ClientId + "_ActiveState] == "1") && (
Session["WhichControlIsActive" ] == this.ClientID) ) // this control
is active
{
SetHeight( this, 400);
this.btnActivateDeAtivate.text = "De Activate";
}
}
btnActivateDeActivate_Click( ... )
{
// Determine whether to Activate or Deactivate the control
if ( Session[ "WhichControlIsActive" ] == this.ClientID
// This was the active control, so deactivate it
{
Session[ this.ClientID + "_ActiveState" ] = "0";
SetHeight( this, 25);
this.btnActivateDeActivate.text = "Activate";
Session[ "WhichControlIsActive" ] = "None";
// I just deactivated the active control, so no control is active
Session[ this.ClientID + "_ActiveState" ] = "0";
// Set this controls session variable of active state to "0"
DoTheRestOfMyStuff( .. );
}
else // This control is
newly the active control
{
Session[ this.ClientID + "_ActiveState" ] = "1"
// Set this control's session variable to "1";
Session[ "WhichControlIsActive " ] = this.ClientID;
// Set the 'Global' session variable to this control
SetHeight( this, 400);
this.btnActivateDeActivate.text = "De Activate";
}
}
Any Suggestions?
ThanksPhillip,
pre_render
Good Luck
DWS
"Phillip N Rounds" wrote:

> I'm working on a UserControl ( ASP.NET 1.1, C#, VS 2003), where I can't
> manage the state of multiple controls correctly.
> The controls have the following constraints
> 1: It has two possible appearances: One 25px high ( InActiveState) with
> just a summary & an 'Activate / DeActivate' button, or the complete (400px
)
> high (Active) control
> 2: Only one control can be active on a page at any given time.
> My problem is that my logic doesn't work ( or, why else would I be posting
> this).
> I have a test container with 3+ controls on it. I activate the first
> control just fine. When I activate the second control, it appears but the
> first control doesn't de-activate. When I activate the third control, the
> first two deactivate. I then activate one of the first two, and the third
> doesn't deactivate. When I activate another, the two previously active
> controls deactivate. I'm wondering if I should move some of the following
> logic to the Page_Unload method, or to the Initialize or PreRender methods
.
> My existing logic is as follows:
> I am handling this using Session Variables, all defined/modified in the
> Page_Load or the btnActivate_DeActivate_Click methods of the MyControl
> class.
> I create a Session variable for each control: Session[ this.ClientId +
> "_ActiveState" ] , = "1" for the active state, "0" otherwise,
> and one session variable to indicate which control is active: Session[
> "WhichControlIsActive" ] = this.ClientId
> of the currently active control
> In MyControl
>
> Page_Load
> {
> if ( Session[this.ClientId + "_ActiveState"] == null ) Session[
> this.ClientId + "_ActiveState"] = "0"; // Initialize null session
> variable for active state to inactive
> if ( Session[ "WhichControlIsActive" ] == null ) Session[
> "WhichControlIsActive" ] == "None"; // Initialize null session
> variable for active control to none
> if ( (Session[this.ClientId + "_ActiveState"] == "0") || (
> Session["WhichControlIsActive" ] != this.ClientId)) // this control
is
> inactive
> {
> SetHeight( this, 25);
> this.btnActivateDeActivate.text = "Activate";
> Session[this.ClientId + "_ActiveState] == "0" ;
> }
> if ( ( Session[this.ClientId + "_ActiveState] == "1") && (
> Session["WhichControlIsActive" ] == this.ClientID) ) // this contro
l
> is active
> {
> SetHeight( this, 400);
> this.btnActivateDeAtivate.text = "De Activate";
> }
> }
> btnActivateDeActivate_Click( ... )
> {
> // Determine whether to Activate or Deactivate the control
> if ( Session[ "WhichControlIsActive" ] == this.ClientID
> // This was the active control, so deactivate it
> {
> Session[ this.ClientID + "_ActiveState" ] = "0";
> SetHeight( this, 25);
> this.btnActivateDeActivate.text = "Activate";
> Session[ "WhichControlIsActive" ] = "None";
> // I just deactivated the active control, so no control is active
> Session[ this.ClientID + "_ActiveState" ] = "0";
> // Set this controls session variable of active state to "0"
> DoTheRestOfMyStuff( .. );
> }
> else // This control is
> newly the active control
> {
> Session[ this.ClientID + "_ActiveState" ] = "1"
> // Set this control's session variable to "1";
> Session[ "WhichControlIsActive " ] = this.ClientID;
> // Set the 'Global' session variable to this control
> SetHeight( this, 400);
> this.btnActivateDeActivate.text = "De Activate";
> }
> }
>
> Any Suggestions?
> Thanks
>
>
>
>
Thanks, that's where I ended up putting most of my logic.
I'm still not happy that I create approximately 200 controls in Page_Load
for each of 10 instances of my user control, then proceed to hide them in
Pre_Render in all but one instance, but that seems the best we can do. Some
other functionality took a lot of really kludgy workaround.
I still think it would be nice if there were some class of variables, e.g.
ImmediateSession["MyKey"], which would reflect actions from a previous
instance of a webform available in the Page_Load of the repost.
Thanks again
"DWS" <DWS@.discussions.microsoft.com> wrote in message
news:D11656E6-E919-4CAB-8682-3CEED492A607@.microsoft.com...
> Phillip,
> pre_render
> Good Luck
> DWS
> "Phillip N Rounds" wrote:
>

Where do I initialize?

I'm working on a UserControl ( ASP.NET 1.1, C#, VS 2003), where I can't
manage the state of multiple controls correctly.

The controls have the following constraints

1: It has two possible appearances: One 25px high ( InActiveState) with
just a summary & an 'Activate / DeActivate' button, or the complete (400px)
high (Active) control
2: Only one control can be active on a page at any given time.

My problem is that my logic doesn't work ( or, why else would I be posting
this).
I have a test container with 3+ controls on it. I activate the first
control just fine. When I activate the second control, it appears but the
first control doesn't de-activate. When I activate the third control, the
first two deactivate. I then activate one of the first two, and the third
doesn't deactivate. When I activate another, the two previously active
controls deactivate. I'm wondering if I should move some of the following
logic to the Page_Unload method, or to the Initialize or PreRender methods.

My existing logic is as follows:

I am handling this using Session Variables, all defined/modified in the
Page_Load or the btnActivate_DeActivate_Click methods of the MyControl
class.
I create a Session variable for each control: Session[ this.ClientId +
"_ActiveState" ] , = "1" for the active state, "0" otherwise,
and one session variable to indicate which control is active: Session[
"WhichControlIsActive" ] = this.ClientId
of the currently active control

In MyControl

Page_Load
{
if ( Session[this.ClientId + "_ActiveState"] == null ) Session[
this.ClientId + "_ActiveState"] = "0"; // Initialize null session
variable for active state to inactive
if ( Session[ "WhichControlIsActive" ] == null ) Session[
"WhichControlIsActive" ] == "None"; // Initialize null session
variable for active control to none

if ( (Session[this.ClientId + "_ActiveState"] == "0") || (
Session["WhichControlIsActive" ] != this.ClientId)) // this control is
inactive
{
SetHeight( this, 25);
this.btnActivateDeActivate.text = "Activate";
Session[this.ClientId + "_ActiveState] == "0" ;
}
if ( ( Session[this.ClientId + "_ActiveState] == "1") && (
Session["WhichControlIsActive" ] == this.ClientID) ) // this control
is active
{
SetHeight( this, 400);
this.btnActivateDeAtivate.text = "De Activate";
}

}

btnActivateDeActivate_Click( ... )
{
// Determine whether to Activate or Deactivate the control
if ( Session[ "WhichControlIsActive" ] == this.ClientID
// This was the active control, so deactivate it
{
Session[ this.ClientID + "_ActiveState" ] = "0";
SetHeight( this, 25);
this.btnActivateDeActivate.text = "Activate";
Session[ "WhichControlIsActive" ] = "None";
// I just deactivated the active control, so no control is active
Session[ this.ClientID + "_ActiveState" ] = "0";
// Set this controls session variable of active state to "0"
DoTheRestOfMyStuff( .. );

}
else // This control is
newly the active control
{
Session[ this.ClientID + "_ActiveState" ] = "1"
// Set this control's session variable to "1";
Session[ "WhichControlIsActive " ] = this.ClientID;
// Set the 'Global' session variable to this control
SetHeight( this, 400);
this.btnActivateDeActivate.text = "De Activate";
}
}

Any Suggestions?

ThanksPhillip,

pre_render

Good Luck
DWS

"Phillip N Rounds" wrote:

> I'm working on a UserControl ( ASP.NET 1.1, C#, VS 2003), where I can't
> manage the state of multiple controls correctly.
> The controls have the following constraints
> 1: It has two possible appearances: One 25px high ( InActiveState) with
> just a summary & an 'Activate / DeActivate' button, or the complete (400px)
> high (Active) control
> 2: Only one control can be active on a page at any given time.
> My problem is that my logic doesn't work ( or, why else would I be posting
> this).
> I have a test container with 3+ controls on it. I activate the first
> control just fine. When I activate the second control, it appears but the
> first control doesn't de-activate. When I activate the third control, the
> first two deactivate. I then activate one of the first two, and the third
> doesn't deactivate. When I activate another, the two previously active
> controls deactivate. I'm wondering if I should move some of the following
> logic to the Page_Unload method, or to the Initialize or PreRender methods.
> My existing logic is as follows:
> I am handling this using Session Variables, all defined/modified in the
> Page_Load or the btnActivate_DeActivate_Click methods of the MyControl
> class.
> I create a Session variable for each control: Session[ this.ClientId +
> "_ActiveState" ] , = "1" for the active state, "0" otherwise,
> and one session variable to indicate which control is active: Session[
> "WhichControlIsActive" ] = this.ClientId
> of the currently active control
> In MyControl
>
> Page_Load
> {
> if ( Session[this.ClientId + "_ActiveState"] == null ) Session[
> this.ClientId + "_ActiveState"] = "0"; // Initialize null session
> variable for active state to inactive
> if ( Session[ "WhichControlIsActive" ] == null ) Session[
> "WhichControlIsActive" ] == "None"; // Initialize null session
> variable for active control to none
> if ( (Session[this.ClientId + "_ActiveState"] == "0") || (
> Session["WhichControlIsActive" ] != this.ClientId)) // this control is
> inactive
> {
> SetHeight( this, 25);
> this.btnActivateDeActivate.text = "Activate";
> Session[this.ClientId + "_ActiveState] == "0" ;
> }
> if ( ( Session[this.ClientId + "_ActiveState] == "1") && (
> Session["WhichControlIsActive" ] == this.ClientID) ) // this control
> is active
> {
> SetHeight( this, 400);
> this.btnActivateDeAtivate.text = "De Activate";
> }
> }
> btnActivateDeActivate_Click( ... )
> {
> // Determine whether to Activate or Deactivate the control
> if ( Session[ "WhichControlIsActive" ] == this.ClientID
> // This was the active control, so deactivate it
> {
> Session[ this.ClientID + "_ActiveState" ] = "0";
> SetHeight( this, 25);
> this.btnActivateDeActivate.text = "Activate";
> Session[ "WhichControlIsActive" ] = "None";
> // I just deactivated the active control, so no control is active
> Session[ this.ClientID + "_ActiveState" ] = "0";
> // Set this controls session variable of active state to "0"
> DoTheRestOfMyStuff( .. );
> }
> else // This control is
> newly the active control
> {
> Session[ this.ClientID + "_ActiveState" ] = "1"
> // Set this control's session variable to "1";
> Session[ "WhichControlIsActive " ] = this.ClientID;
> // Set the 'Global' session variable to this control
> SetHeight( this, 400);
> this.btnActivateDeActivate.text = "De Activate";
> }
> }
>
> Any Suggestions?
> Thanks
>
>
>
Thanks, that's where I ended up putting most of my logic.

I'm still not happy that I create approximately 200 controls in Page_Load
for each of 10 instances of my user control, then proceed to hide them in
Pre_Render in all but one instance, but that seems the best we can do. Some
other functionality took a lot of really kludgy workaround.

I still think it would be nice if there were some class of variables, e.g.
ImmediateSession["MyKey"], which would reflect actions from a previous
instance of a webform available in the Page_Load of the repost.

Thanks again

"DWS" <DWS@.discussions.microsoft.com> wrote in message
news:D11656E6-E919-4CAB-8682-3CEED492A607@.microsoft.com...
> Phillip,
> pre_render
> Good Luck
> DWS
> "Phillip N Rounds" wrote:
>> I'm working on a UserControl ( ASP.NET 1.1, C#, VS 2003), where I can't
>> manage the state of multiple controls correctly.
>>
>> The controls have the following constraints
>>
>> 1: It has two possible appearances: One 25px high ( InActiveState) with
>> just a summary & an 'Activate / DeActivate' button, or the complete
>> (400px)
>> high (Active) control
>> 2: Only one control can be active on a page at any given time.
>>
>> My problem is that my logic doesn't work ( or, why else would I be
>> posting
>> this).
>> I have a test container with 3+ controls on it. I activate the first
>> control just fine. When I activate the second control, it appears but
>> the
>> first control doesn't de-activate. When I activate the third control,
>> the
>> first two deactivate. I then activate one of the first two, and the
>> third
>> doesn't deactivate. When I activate another, the two previously active
>> controls deactivate. I'm wondering if I should move some of the
>> following
>> logic to the Page_Unload method, or to the Initialize or PreRender
>> methods.
>>
>> My existing logic is as follows:
>>
>> I am handling this using Session Variables, all defined/modified in the
>> Page_Load or the btnActivate_DeActivate_Click methods of the MyControl
>> class.
>> I create a Session variable for each control: Session[ this.ClientId +
>> "_ActiveState" ] , = "1" for the active state, "0" otherwise,
>> and one session variable to indicate which control is active: Session[
>> "WhichControlIsActive" ] = this.ClientId
>> of the currently active control
>>
>> In MyControl
>>
>>
>> Page_Load
>> {
>> if ( Session[this.ClientId + "_ActiveState"] == null ) Session[
>> this.ClientId + "_ActiveState"] = "0"; // Initialize null session
>> variable for active state to inactive
>> if ( Session[ "WhichControlIsActive" ] == null ) Session[
>> "WhichControlIsActive" ] == "None"; // Initialize null session
>> variable for active control to none
>>
>> if ( (Session[this.ClientId + "_ActiveState"] == "0") || (
>> Session["WhichControlIsActive" ] != this.ClientId)) // this control
>> is
>> inactive
>> {
>> SetHeight( this, 25);
>> this.btnActivateDeActivate.text = "Activate";
>> Session[this.ClientId + "_ActiveState] == "0" ;
>> }
>> if ( ( Session[this.ClientId + "_ActiveState] == "1") && (
>> Session["WhichControlIsActive" ] == this.ClientID) ) // this
>> control
>> is active
>> {
>> SetHeight( this, 400);
>> this.btnActivateDeAtivate.text = "De Activate";
>> }
>>
>> }
>>
>> btnActivateDeActivate_Click( ... )
>> {
>> // Determine whether to Activate or Deactivate the control
>> if ( Session[ "WhichControlIsActive" ] == this.ClientID
>> // This was the active control, so deactivate it
>> {
>> Session[ this.ClientID + "_ActiveState" ] = "0";
>> SetHeight( this, 25);
>> this.btnActivateDeActivate.text = "Activate";
>> Session[ "WhichControlIsActive" ] = "None";
>> // I just deactivated the active control, so no control is active
>> Session[ this.ClientID + "_ActiveState" ] = "0";
>> // Set this controls session variable of active state to "0"
>> DoTheRestOfMyStuff( .. );
>>
>> }
>> else // This control
>> is
>> newly the active control
>> {
>> Session[ this.ClientID + "_ActiveState" ] = "1"
>> // Set this control's session variable to "1";
>> Session[ "WhichControlIsActive " ] = this.ClientID;
>> // Set the 'Global' session variable to this control
>> SetHeight( this, 400);
>> this.btnActivateDeActivate.text = "De Activate";
>> }
>> }
>>
>>
>> Any Suggestions?
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>

Where do I increase the timeout for the server when processing a script

Where do I increase the timeout for the server when processing a script?

On the page where my button is?

In the code of the button.

In the code of the module?

In the code in the component?

I plan to use the code Server.ScriptTimeout = 600

Here are the steps of execution……..

A page is loaded with a button on it.

The code starts in the code behind of a button.

The code in the button calls a function in a module

That function creates a component and executes a function, in the component, where the code lies that does all the LONG work the needs the extended timeout.

So where do I increase the timeout for the server when processing a script?

Thanks

Hi There,

I think this post might be relevant to your problem,

have a look .http://www.velocityreviews.com/forums/t101706-scripttimeout-and-executiontimeout-do-not-work.html ;)

Where do I place the dll?

I have a legacy dll built in C++ 6.0 (not a com dll, just a plain dll withou
t
a type library). I am using Interop Services to call this dll from an aspx.c
s
page ([DLLImport]). However when I place the dll in the bin folder I get "dll
not found". When I place it in Windows/System32 the webpage just spins and
doesn't return any result. Obviously the dll is not getting loaded. Where do
I need to place the dll?
Message posted via http://www.webservertalk.comsystem32 should be fine IMO. For a test you could also try with the full
path to the DLL.
I would try with a Windows test application. IMO it's rather some problem
caused by the execution context (rights, no user profile etc...).
Patrice
"Andy Sutorius via webservertalk.com" <u9025@.uwe> a crit dans le message de
news:5a7ee7192cf72@.uwe...
> I have a legacy dll built in C++ 6.0 (not a com dll, just a plain dll
without
> a type library). I am using Interop Services to call this dll from an
aspx.cs
> page ([DLLImport]). However when I place the dll in the bin folder I get
"dll
> not found". When I place it in Windows/System32 the webpage just spins and
> doesn't return any result. Obviously the dll is not getting loaded. Where
do
> I need to place the dll?
> --
> Message posted via http://www.webservertalk.com
I will try the full path.
I already tried with a Windows test and it ran perfectly. With this test the
dll was in the root folder of the .exe that I fired off.
Patrice wrote:
>system32 should be fine IMO. For a test you could also try with the full
>path to the DLL.
>I would try with a Windows test application. IMO it's rather some problem
>caused by the execution context (rights, no user profile etc...).
>
Message posted via http://www.webservertalk.com
I will try the full path.
I already tried with a Windows test and it ran perfectly. With this test the
dll was in the root folder of the .exe that I fired off.
Patrice wrote:
>system32 should be fine IMO. For a test you could also try with the full
>path to the DLL.
>I would try with a Windows test application. IMO it's rather some problem
>caused by the execution context (rights, no user profile etc...).
>
Message posted via http://www.webservertalk.com

Where do I place the dll?

I have a legacy dll built in C++ 6.0 (not a com dll, just a plain dll without
a type library). I am using Interop Services to call this dll from an aspx.cs
page ([DLLImport]). However when I place the dll in the bin folder I get "dll
not found". When I place it in Windows/System32 the webpage just spins and
doesn't return any result. Obviously the dll is not getting loaded. Where do
I need to place the dll?

--
Message posted via http://www.dotnetmonster.comsystem32 should be fine IMO. For a test you could also try with the full
path to the DLL.

I would try with a Windows test application. IMO it's rather some problem
caused by the execution context (rights, no user profile etc...).

--
Patrice

"Andy Sutorius via DotNetMonster.com" <u9025@.uwe> a crit dans le message de
news:5a7ee7192cf72@.uwe...
> I have a legacy dll built in C++ 6.0 (not a com dll, just a plain dll
without
> a type library). I am using Interop Services to call this dll from an
aspx.cs
> page ([DLLImport]). However when I place the dll in the bin folder I get
"dll
> not found". When I place it in Windows/System32 the webpage just spins and
> doesn't return any result. Obviously the dll is not getting loaded. Where
do
> I need to place the dll?
> --
> Message posted via http://www.dotnetmonster.com
I will try the full path.

I already tried with a Windows test and it ran perfectly. With this test the
dll was in the root folder of the .exe that I fired off.

Patrice wrote:
>system32 should be fine IMO. For a test you could also try with the full
>path to the DLL.
>I would try with a Windows test application. IMO it's rather some problem
>caused by the execution context (rights, no user profile etc...).
>> I have a legacy dll built in C++ 6.0 (not a com dll, just a plain dll without
>> a type library). I am using Interop Services to call this dll from an aspx.cs
>> page ([DLLImport]). However when I place the dll in the bin folder I get "dll
>> not found". When I place it in Windows/System32 the webpage just spins and
>> doesn't return any result. Obviously the dll is not getting loaded. Where do
>> I need to place the dll?

--
Message posted via http://www.dotnetmonster.com
I will try the full path.

I already tried with a Windows test and it ran perfectly. With this test the
dll was in the root folder of the .exe that I fired off.

Patrice wrote:
>system32 should be fine IMO. For a test you could also try with the full
>path to the DLL.
>I would try with a Windows test application. IMO it's rather some problem
>caused by the execution context (rights, no user profile etc...).
>> I have a legacy dll built in C++ 6.0 (not a com dll, just a plain dll without
>> a type library). I am using Interop Services to call this dll from an aspx.cs
>> page ([DLLImport]). However when I place the dll in the bin folder I get "dll
>> not found". When I place it in Windows/System32 the webpage just spins and
>> doesn't return any result. Obviously the dll is not getting loaded. Where do
>> I need to place the dll?

--
Message posted via http://www.dotnetmonster.com

Where do I place the code for a contact form?

Here is the code I was given:
Imports System.Web.Mail

Private Sub SendMail_Click(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles SendMail.Click
Dim mailMessage As New MailMessage()
mailMessage.From = TextBox1.Text
mailMessage.To = "admin@dotnet.itags.org.startvbdotnet.com"
'you also can set this to TextBox2.Text
mailMessage.Cc = TextBox3.Text
mailMessage.Bcc = TextBox4.Text
mailMessage.Subject = TextBox5.Text
mailMessage.BodyFormat = MailFormat.Text
mailMessage.Body = TextBox6.Text
'textbox6 TextMode property is set to MultiLine
mailMessage.Priority = MailPriority.Normal
SmtpMail.SmtpServer = "mail.yourserver.com"
'mail server used to send this email. modify this line based on your mail server
SmtpMail.Send(mailMessage)
Label6.Text = "Your mail was sent"
'message stating the mail is sent
End Sub

Private Sub Reset_Click(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles Reset.Click
TextBox1.Text = " "
TextBox2.Text = " "
TextBox3.Text = " "
TextBox4.Text = " "
TextBox5.Text = " "
TextBox6.Text = " "
'resetting all the value to default i.e null
End Sub

I need where on the aspx page it needs to go.
I am a complete newbie to ASP.NET

You can either put the code in a seperate code file or in the same file as the web form towards the top in between script tags.

< script runat="server" >
[Code here]
< / script >


Whew!, well I finaly got it to work!. Now I want a button on the samepage, when clicked will send the broser to a new URL. Is this possible?
Thanks,
Paul

If you add Response.Redirect("SomeUrl") to the bottom of the SendMail_Click method, it will redirect to a URL after it executes all the code. If you just want a redirect button, then a simple input button will do.

< input type="button" value="Button Text" onClick="window.location.href='SomeUrl'" / >

where do i place my events?

where do i place these?


Sub session_OnStart
Dim intOnline As Integer
intOnline = intOnline + 1
End Sub

Sub session_OnEnd
Dim intOnline As Integer
intOnline = intOnline - 1
End Sub

Sub application_OnStart
Dim intOnline As Integer
intOnline = 0
End Sub

In your global.asax file.

Brian
My friend, before placing these lines of code, try to understand what they are and you have to place them in the global file.

regards.
i know what they are =P, im just not familiar with asp.net.

Where do I place Imports System.Math

I have this code

===================
Imports System.Math

Sub btnCalculate_Click(sender As Object, e As EventArgs)

Dim LoanPayment as Single

'Use Pmt function to determine payment for 36 month loan

LoanPayment = Pmt(txtInterest.text / 12, 36, txtAmount.text)

txtPayment.text = Format(Abs(LoanPayment), "$0.00")

End Sub
===================

But when I run it I get the following Err Msg

===================
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30465: 'Imports' statements must precede any declarations.

Source Error:

Line 2: <script runat="server">
Line 3:
Line 4: Imports System.Math
Line 5:
Line 6:
===================
In the All Tab I have

<%@dotnet.itags.org. Page Language="VB" %>
<script runat="server"
Imports System.Math

Sub btnCalculate_Click(sender As Object, e As EventArgs)

Dim LoanPayment as Single

'Use Pmt function to determine payment for 36 month loan

LoanPayment = Pmt(txtInterest.text / 12, 36, txtAmount.text)

txtPayment.text = Format(Abs(LoanPayment), "$0.00")

End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<font size="5">Car Loan Calculator</font>
</p>
<p>
Enter the required information and clickCalculate!
</p>
<p>
<asp:TextBox id="txtAmount" runat="server"></asp:TextBox>
<asp:Label id="Label1" runat="server">Loan Amount</asp:Label>
</p>
<p>
<asp:TextBox id="txtInterest" runat="server"></asp:TextBox>
<asp:Label id="Label2" runat="server">Interest Rate</asp:Label>
</p>
<p>
<asp:TextBox id="txtPayment" runat="server"></asp:TextBox>
<asp:Label id="Label3" runat="server">Monthly Payment</asp:Label>
</p>
<p>
<asp:Button id="btnCalculate" onclick="btnCalculate_Click" runat="server" Text="Calculate"></asp:Button>
</p>
<!-- Insert content here -->
</form>
</body>
</html>
===================

I tried moving the Imports System.Math to the top but then I get a msg that the abs is not recognize<%@.Import Namespace="System.Math"%>
Thank You! Now it works ;-)

Where do I keep common classes that every one of my pages should use?

I have several C# classes that I would like every page in my website to have access to. Is there some kind of "global" file I can put these into, or make them available some other way?

Thanks!

The standard way for small projects is to add it to the APP_CODE folder. If you don't have one, right click on the project and pick "Add ASP NET folder" and pick APP_CODE. That makes stuff generally consumable by your web site (double check your namespaces and stuff though!)

I put all global files in my App_Code Directory as do most asp.net developers from what I have seen. Then I add two subdirectories one BLL-Business Logic Layer and one DAL - Data Access Layer. This is a fairly standard way of doing it. This is known as the three tier model makes it easier when using claases that your grab accross many pages.

BC

Where do I put a generic function used in all pages?

Hi all,

I'm still learning asp.net so this may seem a simple question, but
here goes anyway. I have a generic function that I wish to access
from all pages in my web application. Intead of putting this
function into the code-behind of every page, is there somewhere I can
put it so that it can access it from all pages? I tried doing it the
same way that I create a class with a namespace etc.. but that didin't
work. I tried placing it in the global.asax but that didn't work
either.

Any help would be appreciated

Thanks

Renecreate a generic page with this function, then inherit from it for all your
other pages, that's what we do with great sucess.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com

"wrecker" <wrecker@.wrecked.com> wrote in message
news:2saf40dgrel9e3nqbg4ipahoeh33hkp01t@.4ax.com...
> Hi all,
> I'm still learning asp.net so this may seem a simple question, but
> here goes anyway. I have a generic function that I wish to access
> from all pages in my web application. Intead of putting this
> function into the code-behind of every page, is there somewhere I can
> put it so that it can access it from all pages? I tried doing it the
> same way that I create a class with a namespace etc.. but that didin't
> work. I tried placing it in the global.asax but that didn't work
> either.
> Any help would be appreciated
> Thanks
> Rene
Well, you could always give your global.asax a classname. The you can add
methods etc to it as you would any other class and they would be available
to the code base.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP

"wrecker" <wrecker@.wrecked.com> wrote in message
news:2saf40dgrel9e3nqbg4ipahoeh33hkp01t@.4ax.com...
> Hi all,
> I'm still learning asp.net so this may seem a simple question, but
> here goes anyway. I have a generic function that I wish to access
> from all pages in my web application. Intead of putting this
> function into the code-behind of every page, is there somewhere I can
> put it so that it can access it from all pages? I tried doing it the
> same way that I create a class with a namespace etc.. but that didin't
> work. I tried placing it in the global.asax but that didn't work
> either.
> Any help would be appreciated
> Thanks
> Rene

Where do I put a function I can call from any page?

I have a function I wrote for use on a page.


I now have a need to use that function on many pages, but I don't want to duplicate the same code on each page.


My question is twofold, where should I store the function and how do I call it from different pages?

You can create a class and inside it create a static method which can be accessed in all webforms.

Suppose you have a class called Class1 and a method inside this class called Method1, you do the below

Class1.Method1()

HC


Chris,

To share functionality in your application, create a class within your web project. You can do this Visual Studio or Visual Web Designer by right-clicking on the project in the solution explorer and choosing "Add Item". You will then be prompted to choose the type of item to add. Choose a "Class", give the class a name, and add it to your project.

Within your class, create a static method. In C# this is done by the marking the function "static". In VB this is done by marking the function "Shared". I'll provide a simple example in VB below:

Class ClassForChrisPublic Shared Function HelloWorld(userNameAs String)As String Return"Hello, " + userName +"!"End End Class

This method can be called from any page by calling: ClassForChris.HelloWorld("Chris")


Hope this helps,

pk


I'm a fan of the BasePage approach. I like to create a base page that has common functionality for all subpages (as well as things like SQL connection string and variables). Here's an idea of how to do it:

public class BasePage : Page{protected String connStr ="[connection string]";//other commonly shared variablesprotected virtual void Page_Load(object sender, System.EventArgs e) {//do some stuff that all pages need to do, like check user's session variables... }protected void CommonFunction() {//Common Function stuff }}public class ChildPage : BasePage{protected override void Page_Load(object sender, System.EventArgs e) {base.Page_Load(sender, e);//do some stuff specific to this page CommonFunction();//You can access "CommonFunction()" because you inherited it from BasePage }}

After I figured that out, it took me a few minutes to figure out how to "include" the parent...do it in your compilation script:

csc /out:basepage.dll /r:System.dll,System.Web.dll,System.Data.dll /t:library basepage.cscsc /out:childpage.dll /r:System.dll,System.Web.dll,System.Data.dll,basepage.dll /t:library childpage.cs

That worked great.

Thanks a lot.

Chris

Where do I put a .dll file?

In my Win Form development I have develop a .ddl file name link42dll.dll. I make a reference by these 2 statements for an external procedure:

[DllImport("link42dll.DLL")]
publicstaticexternint startit();
My question is where I put that file in the web form ASP.NET project in order to make a similar reference.
Thanks in advance,
ngungo

Create a folder named bin under your web application and place the dll fine in that folder.

Where do I put my public subs and functions in an ASP.NET project?

I'm new to ASP.NET (and .NET in general), coming from VB 6 background. In the past, I would create a "toolbox" module and put my public subs and functions in there if they were going to be accessed from a number of areas of my project.

I'm sure I probably need to change my thinking a bit on how I structure these ASP.NET applications, but is there a place I can put code that can be called from all of my web forms? Is there a good place to look at examples of good ASP.NET code structure, etc?I usually create a "globals" class and define these methods as static (C#) or shared (vb) in the class. So you end up writing stuff like:
lblSigma = globals.CalcSigma(dblFci)
One way to do it is to implement a BasePage class that all you webforms could derive from.

Check this article out:
aspalliance
So, just to clarify (I'm really new), I should create a VB.NET class library project with my functions in it and build it into a DLL.

Once that is done, what steps do I need to go through to make my ASP.NET project recognize it?

Thanks again!
If you use the BasePage approach you can build a class library and then add that assembly as a reference in you main project.
If you use the global.asax approach with shared functions you don't have to create a separate project. The codebehind for global.asax.vb is compiled into your mainproject assembly.
I would just add a new class to your existing project. No need to create a new project.
Jim, I guess I'm not familar enough with vs.net to know how to do that. What do I "click" to add a class to my existing project?

Thanks again to everyone for the info.
Right-click on the project itself in project-explorer. Choose "Add" then "Add Class".

I keep all of my code like this, including DAL, BLL, etc. in a "Code" directory within the project, but you can put it anywhere.

Where do I put my Database relations... at DATABASE level or in PROGRAM LEVEL?

Mybe it's a stupid question but :
I'm starting to learn VB.NET. I have some basic skills. I'm from
Mainframe world and I have same question to make my DATABASES (tables
and relation)
I would like to make ask my question by example. Let's say I'm a
sales company I'm selling products to customers. Okay?
I have these tables (databases) and fields and I have these questions.
I have created these tables in VB.NET Database Connections IDE
interface. These 3 files and fields are visually created and I have
also entered some test data.
This is the structure: 1 Customer can have Multiple order, 1
OrderHeader can have Multiple orderDetaillines.
So I only store in OrderHeader the Main things like customer, Order
remark. Everything which is related to product I store it in
OrderDetailTalbe like product, price etc.
MY Intention: I don't want to set my RELEATIONS on DATABASE level,
but in PROGRAM LEVEL, I mean I don't want to visualize to draw a line
from Customer table to Order Header and from Order Header to Order
Detail.......
In Mainframe world we don't put DATABASE relations in DATABASE level,
but in PROGRAM level. .....
My QUESTION: IS this allowed by VB.NET? Can I build an application
like this? Is this a correct way to do? Or do I need to make a Database
Relation DIAGRAM?
WHAT is your idea about it as Experienced VB.NET programmer?
1) CustomerTable
==============
- Customer ID
- Customer Name
- Customer Address
- Customer City
- Customer Country
- Customer Payment term
2) OrderHeaderTable
=================
- Order Number
- Order Type
- Order line
- Customer ID
- OrderRemark
-
3) OrderDetailTable
===============
- Order Number
- Order Type
- Order line
- Customer ID
- Product
- Sales price
- Extented price
Thanks
MesutI am not really an expert on this but I think you obtain everything your
want by way of your SQL statement.
For example if you want to display a list of products of an order by a
particular customer, and assuming that you have created three tables
(Customers, Orders and Orderlines), your SQL statement would be something
like
SELECT c.Firstname, c.Lastname, l.productID, l.productname FROM Customers as
c
INNER JOIN Orders AS o ON c.CustomerID = o.CustomerID
INNER JOIN Orderlines AS l ON o.OrderID = l.OrderID
WHERE c.CustomerID = 23 AND o.OrderID = 10
ORDER BY l.ProductID
The values 23 and 10 are just example.
Then you can build your code to display the resulting output.
Cheers
TB
<mesut@.edpnet.be> wrote in message
news:1142514541.251376.320740@.z34g2000cwc.googlegroups.com...
> Mybe it's a stupid question but :
> I'm starting to learn VB.NET. I have some basic skills. I'm from
> Mainframe world and I have same question to make my DATABASES (tables
> and relation)
> I would like to make ask my question by example. Let's say I'm a
> sales company I'm selling products to customers. Okay?
> I have these tables (databases) and fields and I have these questions.
> I have created these tables in VB.NET Database Connections IDE
> interface. These 3 files and fields are visually created and I have
> also entered some test data.
> This is the structure: 1 Customer can have Multiple order, 1
> OrderHeader can have Multiple orderDetaillines.
> So I only store in OrderHeader the Main things like customer, Order
> remark. Everything which is related to product I store it in
> OrderDetailTalbe like product, price etc.
> MY Intention: I don't want to set my RELEATIONS on DATABASE level,
> but in PROGRAM LEVEL, I mean I don't want to visualize to draw a line
> from Customer table to Order Header and from Order Header to Order
> Detail.......
> In Mainframe world we don't put DATABASE relations in DATABASE level,
> but in PROGRAM level. .....
> My QUESTION: IS this allowed by VB.NET? Can I build an application
> like this? Is this a correct way to do? Or do I need to make a Database
> Relation DIAGRAM?
> WHAT is your idea about it as Experienced VB.NET programmer?
> 1) CustomerTable
> ==============
> - Customer ID
> - Customer Name
> - Customer Address
> - Customer City
> - Customer Country
> - Customer Payment term
> 2) OrderHeaderTable
> =================
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - OrderRemark
> -
> 3) OrderDetailTable
> ===============
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - Product
> - Sales price
> - Extented price
>
> Thanks
> Mesut
>
Just to make sure, the "diagram" establish behind the scene the referential
integrity (using FOREIGN KEY constraints). You can do it in script if you
prefer.
My personal preference would be to always have referential integrity defined
in the DB. It will prevent an inconsistent database if your program by
mistake doesn't enforce this correctly plus it will prevent to introduce
inconsistencies from whatever else could access the database or when it
evolves etc...
That said if you have the same compelling reason than on mainframes for not
doing so, you are anyway never forced to define this in your DB...
Patrice
<mesut@.edpnet.be> a crit dans le message de news:
1142514541.251376.320740@.z34g2000cwc.googlegroups.com...
> Mybe it's a stupid question but :
> I'm starting to learn VB.NET. I have some basic skills. I'm from
> Mainframe world and I have same question to make my DATABASES (tables
> and relation)
> I would like to make ask my question by example. Let's say I'm a
> sales company I'm selling products to customers. Okay?
> I have these tables (databases) and fields and I have these questions.
> I have created these tables in VB.NET Database Connections IDE
> interface. These 3 files and fields are visually created and I have
> also entered some test data.
> This is the structure: 1 Customer can have Multiple order, 1
> OrderHeader can have Multiple orderDetaillines.
> So I only store in OrderHeader the Main things like customer, Order
> remark. Everything which is related to product I store it in
> OrderDetailTalbe like product, price etc.
> MY Intention: I don't want to set my RELEATIONS on DATABASE level,
> but in PROGRAM LEVEL, I mean I don't want to visualize to draw a line
> from Customer table to Order Header and from Order Header to Order
> Detail.......
> In Mainframe world we don't put DATABASE relations in DATABASE level,
> but in PROGRAM level. .....
> My QUESTION: IS this allowed by VB.NET? Can I build an application
> like this? Is this a correct way to do? Or do I need to make a Database
> Relation DIAGRAM?
> WHAT is your idea about it as Experienced VB.NET programmer?
> 1) CustomerTable
> ==============
> - Customer ID
> - Customer Name
> - Customer Address
> - Customer City
> - Customer Country
> - Customer Payment term
> 2) OrderHeaderTable
> =================
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - OrderRemark
> -
> 3) OrderDetailTable
> ===============
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - Product
> - Sales price
> - Extented price
>
> Thanks
> Mesut
>
>>... Or do I need to make a Database Relation DIAGRAM?<<
If you create your tables properly using FOREIGN KEY constraints the
software (e.g., visio, enterprise manager, ERwin, Mgmt Studio) will be
able to automatically create a diagram that shows table relations.
This is an abreviated example of the proper way to create the tables
in SQL Server 2005.
-- Code
CREATE TABLE Customers
(
CU_ID int PRIMARY KEY,
CU_Name varchar(30) NOT NULL,
CU_Address varchar(50) NOT NULL,
CU_City varchar(30) NOT NULL,
CU_Country varchar(30) NOT NULL,
CU_PaymenTerm varchar(30) NOT NULL
);
CREATE TABLE Products
(
PR_ID int PRIMARY KEY,
PR_Description varchar(100) NOT NULL,
PR_Price smallmoney NOT NULL,
PR_Qty smallint NOT NULL
);
CREATE TABLE Orders
(
OR_ID int PRIMARY KEY,
CU_ID int FOREIGN KEY REFERENCES Customers(CU_ID),
OR_Type varchar(30) NOT NULL,
OR_Description varchar(1000) NULL
);
CREATE TABLE OrderDetails
(
OD_ID tinyint PRIMARY KEY,
OR_ID int FOREIGN KEY REFERENCES Orders(OR_ID),
PR_ID int FOREIGN KEY REFERENCES Products(PR_ID),
PR_Price smallmoney NOT NULL,
OD_Qty smallint NOT NULL
);
-- End of Code
IMO, it is much better to use SQL instead of the GUI to create
your tables. The main benefit, at least for me, is it forces me to
think through the design. Plus, I can recreate the entire database
easily when a design change is made.
Garth
www.SQLBook.com
Thank you all, all information was really useful
If I correct understand I can better use constrains (database
relations) but it's not obligated by the system (Visual
Studio.Net)...
TB : Thank you for the SQL sample, that was also the my idea to use
it.
Patrice: I think you've got the right words... I don't want to
define Foreign Key Constrains. In Mainframe we just read the
OrderHeader and then we read OrderDetail in the program. But there is
no constrains (links with tables). But I agree then you can have
OrderDetail Record information without OrderHeader Record, but this is
not my issue for the moment...
Garth: That sample is also very good. I'm using Visual Studio.NET
Express Edtion + SQL 2005 Express... Where do you type your code to
create these tables?
sorry guys here is my last queston:
- When a Field e.g. Payment term is NOT NULL means : when the primary
field is filled in (record created) the NOT NULL fields are obligated
to fill in. You should have filled in a value CORRECT?
regards,
Mesut
Thats right.
Whenever a new row is added, something has to be put into a Not Null column,
for example a 0 for a numeric column or an empty space for a varchar column.
TB
<mesut@.edpnet.be> wrote in message
news:1142528814.477457.206590@.i39g2000cwa.googlegroups.com...
> Thank you all, all information was really useful
> If I correct understand I can better use constrains (database
> relations) but it's not obligated by the system (Visual
> Studio.Net)...
> TB : Thank you for the SQL sample, that was also the my idea to use
> it.
> Patrice: I think you've got the right words... I don't want to
> define Foreign Key Constrains. In Mainframe we just read the
> OrderHeader and then we read OrderDetail in the program. But there is
> no constrains (links with tables). But I agree then you can have
> OrderDetail Record information without OrderHeader Record, but this is
> not my issue for the moment...
> Garth: That sample is also very good. I'm using Visual Studio.NET
> Express Edtion + SQL 2005 Express... Where do you type your code to
> create these tables?
> sorry guys here is my last queston:
> - When a Field e.g. Payment term is NOT NULL means : when the primary
> field is filled in (record created) the NOT NULL fields are obligated
> to fill in. You should have filled in a value CORRECT?
> regards,
> Mesut
>
> Garth: That sample is also very good. I'm using Visual Studio.NET
> Express Edtion + SQL 2005 Express... Where do you type your code to
> create these tables?
Go to Microsoft's website and look for: Microsoft SQL Server
Management Studio Express. I believe there are other free tools
available, but cannot recommend any because I haven't used them.
One more thing...you were asking about NOT NULL...If possible,
I like to define the domain of a column via a CHECK constraint when
creating a table. This accomplishes two goals:
1. It prohibits invalid data from being inserted into the column, and
2. It allows other developers to know more about the data more
quickly.
It's one thing to know a column can accept up to thirty characters
(e.g., varchar(30)), but it really helps to know that the only valid entries
are x, y and z. And, of course, it is also helpful to define DEFAULT
constraints as well.
The following table definition is from my current project...it contains
examples of these types of constraints.
CREATE TABLE WorkItems
(
WI_ID int PRIMARY KEY,
WI_Type varchar(8) NOT NULL CHECK (WI_Type IN ('Issue','Project','Task')),
WI_Title varchar(100) NULL,
WI_Priority varchar(10) NULL CHECK (WI_Priority IN ('(1) High','(2)
Normal','(3) Low')),
WS_ID tinyint FOREIGN KEY REFERENCES WorkItemStatuses(WS_ID),
WI_PercentComplete varchar(3) NULL,
WI_AssignedTo int NULL REFERENCES Employees(EM_ID),-- Holds ProjectLeader fo
r
Projects
WI_Description varchar(1000) NULL, -- Holds Comment for Issues
WI_StartDate datetime NULL,
WI_DueDate datetime NULL,
WI_CreatedDate datetime NOT NULL DEFAULT GETDATE(),
WI_CreatedBy int NOT NULL REFERENCES Employees(EM_ID),
WI_LastModifiedDate datetime NULL,
WI_LastModifiedBy int NULL REFERENCES Employees(EM_ID),
WI_Caller int NULL REFERENCES Employees(EM_ID),
BR_ID varchar(15) NULL REFERENCES Branches(BR_ID),
WC_ID tinyint NULL FOREIGN KEY REFERENCES WorkItemCategories(WC_ID),
WI_EmployeeWithIssuePhoneNumber varchar(15) NULL,
);
Garth
www.sqlbook.com
One last thing...you should post your database design/programming
related questions in microsoft.public.sqlserver.programming. There
are a lot of very smart, helpful people that monitor that newsgroup
and you will get excellent answers and tips. At least that's always
been my experience.
Thanks guys. I have learned more today. I will follow your advices.
regards,
Mesut

Where do I put my Database relations... at DATABASE level or in PROGRAM LEVEL?

Mybe it's a stupid question but :
I'm starting to learn VB.NET. I have some basic skills. I'm from
Mainframe world and I have same question to make my DATABASES (tables
and relation)
I would like to make ask my question by example. Let's say I'm a
sales company I'm selling products to customers. Okay?
I have these tables (databases) and fields and I have these questions.

I have created these tables in VB.NET Database Connections IDE
interface. These 3 files and fields are visually created and I have
also entered some test data.
This is the structure: 1 Customer can have Multiple order, 1
OrderHeader can have Multiple orderDetaillines.
So I only store in OrderHeader the Main things like customer, Order
remark. Everything which is related to product I store it in
OrderDetailTalbe like product, price etc.

MY Intention: I don't want to set my RELEATIONS on DATABASE level,
but in PROGRAM LEVEL, I mean I don't want to visualize to draw a line
from Customer table to Order Header and from Order Header to Order
Detail.......
In Mainframe world we don't put DATABASE relations in DATABASE level,
but in PROGRAM level. .....
My QUESTION: IS this allowed by VB.NET? Can I build an application
like this? Is this a correct way to do? Or do I need to make a Database
Relation DIAGRAM?

WHAT is your idea about it as Experienced VB.NET programmer?

1) CustomerTable
==============
- Customer ID
- Customer Name
- Customer Address
- Customer City
- Customer Country
- Customer Payment term

2) OrderHeaderTable
=================
- Order Number
- Order Type
- Order line
- Customer ID
- OrderRemark
-

3) OrderDetailTable
===============
- Order Number
- Order Type
- Order line
- Customer ID
- Product
- Sales price
- Extented price

Thanks
MesutI am not really an expert on this but I think you obtain everything your
want by way of your SQL statement.

For example if you want to display a list of products of an order by a
particular customer, and assuming that you have created three tables
(Customers, Orders and Orderlines), your SQL statement would be something
like
SELECT c.Firstname, c.Lastname, l.productID, l.productname FROM Customers as
c
INNER JOIN Orders AS o ON c.CustomerID = o.CustomerID
INNER JOIN Orderlines AS l ON o.OrderID = l.OrderID
WHERE c.CustomerID = 23 AND o.OrderID = 10
ORDER BY l.ProductID

The values 23 and 10 are just example.

Then you can build your code to display the resulting output.

Cheers

TB

<mesut@.edpnet.be> wrote in message
news:1142514541.251376.320740@.z34g2000cwc.googlegr oups.com...
> Mybe it's a stupid question but :
> I'm starting to learn VB.NET. I have some basic skills. I'm from
> Mainframe world and I have same question to make my DATABASES (tables
> and relation)
> I would like to make ask my question by example. Let's say I'm a
> sales company I'm selling products to customers. Okay?
> I have these tables (databases) and fields and I have these questions.
> I have created these tables in VB.NET Database Connections IDE
> interface. These 3 files and fields are visually created and I have
> also entered some test data.
> This is the structure: 1 Customer can have Multiple order, 1
> OrderHeader can have Multiple orderDetaillines.
> So I only store in OrderHeader the Main things like customer, Order
> remark. Everything which is related to product I store it in
> OrderDetailTalbe like product, price etc.
> MY Intention: I don't want to set my RELEATIONS on DATABASE level,
> but in PROGRAM LEVEL, I mean I don't want to visualize to draw a line
> from Customer table to Order Header and from Order Header to Order
> Detail.......
> In Mainframe world we don't put DATABASE relations in DATABASE level,
> but in PROGRAM level. .....
> My QUESTION: IS this allowed by VB.NET? Can I build an application
> like this? Is this a correct way to do? Or do I need to make a Database
> Relation DIAGRAM?
> WHAT is your idea about it as Experienced VB.NET programmer?
> 1) CustomerTable
> ==============
> - Customer ID
> - Customer Name
> - Customer Address
> - Customer City
> - Customer Country
> - Customer Payment term
> 2) OrderHeaderTable
> =================
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - OrderRemark
> -
> 3) OrderDetailTable
> ===============
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - Product
> - Sales price
> - Extented price
>
> Thanks
> Mesut
Just to make sure, the "diagram" establish behind the scene the referential
integrity (using FOREIGN KEY constraints). You can do it in script if you
prefer.

My personal preference would be to always have referential integrity defined
in the DB. It will prevent an inconsistent database if your program by
mistake doesn't enforce this correctly plus it will prevent to introduce
inconsistencies from whatever else could access the database or when it
evolves etc...

That said if you have the same compelling reason than on mainframes for not
doing so, you are anyway never forced to define this in your DB...

--
Patrice

<mesut@.edpnet.be> a crit dans le message de news:
1142514541.251376.320740@.z34g2000cwc.googlegroups. com...
> Mybe it's a stupid question but :
> I'm starting to learn VB.NET. I have some basic skills. I'm from
> Mainframe world and I have same question to make my DATABASES (tables
> and relation)
> I would like to make ask my question by example. Let's say I'm a
> sales company I'm selling products to customers. Okay?
> I have these tables (databases) and fields and I have these questions.
> I have created these tables in VB.NET Database Connections IDE
> interface. These 3 files and fields are visually created and I have
> also entered some test data.
> This is the structure: 1 Customer can have Multiple order, 1
> OrderHeader can have Multiple orderDetaillines.
> So I only store in OrderHeader the Main things like customer, Order
> remark. Everything which is related to product I store it in
> OrderDetailTalbe like product, price etc.
> MY Intention: I don't want to set my RELEATIONS on DATABASE level,
> but in PROGRAM LEVEL, I mean I don't want to visualize to draw a line
> from Customer table to Order Header and from Order Header to Order
> Detail.......
> In Mainframe world we don't put DATABASE relations in DATABASE level,
> but in PROGRAM level. .....
> My QUESTION: IS this allowed by VB.NET? Can I build an application
> like this? Is this a correct way to do? Or do I need to make a Database
> Relation DIAGRAM?
> WHAT is your idea about it as Experienced VB.NET programmer?
> 1) CustomerTable
> ==============
> - Customer ID
> - Customer Name
> - Customer Address
> - Customer City
> - Customer Country
> - Customer Payment term
> 2) OrderHeaderTable
> =================
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - OrderRemark
> -
> 3) OrderDetailTable
> ===============
> - Order Number
> - Order Type
> - Order line
> - Customer ID
> - Product
> - Sales price
> - Extented price
>
> Thanks
> Mesut
>>... Or do I need to make a Database Relation DIAGRAM?<<

If you create your tables properly using FOREIGN KEY constraints the
software (e.g., visio, enterprise manager, ERwin, Mgmt Studio) will be
able to automatically create a diagram that shows table relations.

This is an abreviated example of the proper way to create the tables
in SQL Server 2005.

-- Code
CREATE TABLE Customers
(
CU_ID int PRIMARY KEY,
CU_Name varchar(30) NOT NULL,
CU_Address varchar(50) NOT NULL,
CU_City varchar(30) NOT NULL,
CU_Country varchar(30) NOT NULL,
CU_PaymenTerm varchar(30) NOT NULL
);

CREATE TABLE Products
(
PR_ID int PRIMARY KEY,
PR_Description varchar(100) NOT NULL,
PR_Price smallmoney NOT NULL,
PR_Qty smallint NOT NULL
);

CREATE TABLE Orders
(
OR_ID int PRIMARY KEY,
CU_ID int FOREIGN KEY REFERENCES Customers(CU_ID),
OR_Type varchar(30) NOT NULL,
OR_Description varchar(1000) NULL
);

CREATE TABLE OrderDetails
(
OD_ID tinyint PRIMARY KEY,
OR_ID int FOREIGN KEY REFERENCES Orders(OR_ID),
PR_ID int FOREIGN KEY REFERENCES Products(PR_ID),
PR_Price smallmoney NOT NULL,
OD_Qty smallint NOT NULL
);
-- End of Code

IMO, it is much better to use SQL instead of the GUI to create
your tables. The main benefit, at least for me, is it forces me to
think through the design. Plus, I can recreate the entire database
easily when a design change is made.

Garth
www.SQLBook.com
Thank you all, all information was really useful

If I correct understand I can better use constrains (database
relations) but it's not obligated by the system (Visual
Studio.Net)...

TB : Thank you for the SQL sample, that was also the my idea to use
it.

Patrice: I think you've got the right words... I don't want to
define Foreign Key Constrains. In Mainframe we just read the
OrderHeader and then we read OrderDetail in the program. But there is
no constrains (links with tables). But I agree then you can have
OrderDetail Record information without OrderHeader Record, but this is
not my issue for the moment...

Garth: That sample is also very good. I'm using Visual Studio.NET
Express Edtion + SQL 2005 Express... Where do you type your code to
create these tables?

sorry guys here is my last queston:
- When a Field e.g. Payment term is NOT NULL means : when the primary
field is filled in (record created) the NOT NULL fields are obligated
to fill in. You should have filled in a value CORRECT?

regards,

Mesut
Thats right.

Whenever a new row is added, something has to be put into a Not Null column,
for example a 0 for a numeric column or an empty space for a varchar column.

TB

<mesut@.edpnet.be> wrote in message
news:1142528814.477457.206590@.i39g2000cwa.googlegr oups.com...
> Thank you all, all information was really useful
> If I correct understand I can better use constrains (database
> relations) but it's not obligated by the system (Visual
> Studio.Net)...
> TB : Thank you for the SQL sample, that was also the my idea to use
> it.
> Patrice: I think you've got the right words... I don't want to
> define Foreign Key Constrains. In Mainframe we just read the
> OrderHeader and then we read OrderDetail in the program. But there is
> no constrains (links with tables). But I agree then you can have
> OrderDetail Record information without OrderHeader Record, but this is
> not my issue for the moment...
> Garth: That sample is also very good. I'm using Visual Studio.NET
> Express Edtion + SQL 2005 Express... Where do you type your code to
> create these tables?
> sorry guys here is my last queston:
> - When a Field e.g. Payment term is NOT NULL means : when the primary
> field is filled in (record created) the NOT NULL fields are obligated
> to fill in. You should have filled in a value CORRECT?
> regards,
> Mesut
> Garth: That sample is also very good. I'm using Visual Studio.NET
> Express Edtion + SQL 2005 Express... Where do you type your code to
> create these tables?

Go to Microsoft's website and look for: Microsoft SQL Server
Management Studio Express. I believe there are other free tools
available, but cannot recommend any because I haven't used them.

One more thing...you were asking about NOT NULL...If possible,
I like to define the domain of a column via a CHECK constraint when
creating a table. This accomplishes two goals:

1. It prohibits invalid data from being inserted into the column, and
2. It allows other developers to know more about the data more
quickly.

It's one thing to know a column can accept up to thirty characters
(e.g., varchar(30)), but it really helps to know that the only valid entries
are x, y and z. And, of course, it is also helpful to define DEFAULT
constraints as well.

The following table definition is from my current project...it contains
examples of these types of constraints.

CREATE TABLE WorkItems
(
WI_ID int PRIMARY KEY,
WI_Type varchar(8) NOT NULL CHECK (WI_Type IN ('Issue','Project','Task')),
WI_Title varchar(100) NULL,
WI_Priority varchar(10) NULL CHECK (WI_Priority IN ('(1) High','(2)
Normal','(3) Low')),
WS_ID tinyint FOREIGN KEY REFERENCES WorkItemStatuses(WS_ID),
WI_PercentComplete varchar(3) NULL,
WI_AssignedTo int NULL REFERENCES Employees(EM_ID),-- Holds ProjectLeader for
Projects
WI_Description varchar(1000) NULL, -- Holds Comment for Issues
WI_StartDate datetime NULL,
WI_DueDate datetime NULL,
WI_CreatedDate datetime NOT NULL DEFAULT GETDATE(),
WI_CreatedBy int NOT NULL REFERENCES Employees(EM_ID),
WI_LastModifiedDate datetime NULL,
WI_LastModifiedBy int NULL REFERENCES Employees(EM_ID),
WI_Caller int NULL REFERENCES Employees(EM_ID),
BR_ID varchar(15) NULL REFERENCES Branches(BR_ID),
WC_ID tinyint NULL FOREIGN KEY REFERENCES WorkItemCategories(WC_ID),
WI_EmployeeWithIssuePhoneNumber varchar(15) NULL,
);

Garth
www.sqlbook.com
One last thing...you should post your database design/programming
related questions in microsoft.public.sqlserver.programming. There
are a lot of very smart, helpful people that monitor that newsgroup
and you will get excellent answers and tips. At least that's always
been my experience.
Thanks guys. I have learned more today. I will follow your advices.

regards,

Mesut