Hello,
I am using Microsoft Visual Studio 2003 .NET.
I have several question, please.
1) I have a connection to the database, which I create it at login,
by application("conMain") (I have some problems by using
session("conMain"), see question 2).
I don't know if it's a good thing to do, and not oppenning at each page the
connection (do I have to open and close a conneciton on each page, or not,
but programming carefully - if so then how shall I program ?) but I want to
know if :
How can I know that user has closed any of the pages, and I should close the
connection (what that happens, is that it's a oleDBConnection to *.mdb file,
and the *.mdb database stay openned, and when I open it in access
enviornment, it is at read only state).
Dialog-Box
---------------
2) I see that when I use dialog-box (by window.showModalDialog), and the
dialog is an aspx page - it opens a new session,
can I stay at the same session as before ?
(I see that parameter Session("aaa") which is known in the calling form, is
unknown at the called dialog box) ?
3) What is the command to close the dialog box ?
4) Dialog box has status bar - can I hide it ? can I put my own text on the
status bar (at the bottom line) ?
5) How can I do refresh to the calling form that called the dialogbox just
after it called it ? (calling form is an aspx page).
6) How can I return the window.dialogArguments, when the dialog-box is an
aspx page ?
------
7) How can I do updates to a query with oleDBCommand (the database is mdb).
I did :
dim cmd as oleDBCommand
.....
cmd.executeNoneQuery
....
What I get that it a message something like : ... not an update query ....
I run the query in the access enviornment, and it looks fine.
What may be wrong ?
8) I have a frameset, that linked to several aspx pages. one of the tabs is
780px width, and is linked to aspx page.
I need that the aspx page will be always 770px.
I cannot see the contour of the width and height when I open the page, and I
could find any automatic method that set always 770px in a new page.
Can I make a default width & height, or is there any simple method to limit
the size of any of the pages, and see immediatelly what happens on the
parent frameset page ?
9) I have an sln project, and for reason I don't know, now I cannot see the
sources of html pages, in a single one page.
What I see is only one of the sources of the pages (i.e main.htm) and I need
each time to double click on the relevant page on the sln explorer, in
oreder to see it.
What's wrong.
Thanks ) 9 1277
> How can I know that user has closed any of the pages,
You can't know. and I should close the connection (what that happens, is that it's a oleDBConnection to *.mdb file, and the *.mdb database stay openned, and when I open it in access enviornment, it is at read only state).
Any server side-code you write will be completed BEFORE the user ever gets
the page to look at in their browser. Therefore, you should always open
your connection early on in your page's processing (like Page_Load), do
whatever work you need to do and then close the connection when your work is
done. It has absolutely nothing to do with the page the user gets in their
browser. By the time they get the results of your code, your database
connection will have already been closed.
I see that you are still using the classic ASP applicatoin variables and
session variables. While both still work ASP.NET provides much more robust
ways to persist state. IMHO: you should stay away from these.
7) How can I do updates to a query with oleDBCommand (the database is mdb). I did : dim cmd as oleDBCommand ....
cmd.executeNoneQuery ...
What I get that it a message something like : ... not an update query .... I run the query in the access enviornment, and it looks fine. What may be wrong ?
Your code above does not create an instance of anything because the keyword
"new" is not being used. Even if you had used it, you haven't configured
your command's CommandText (like a SQL statement or stored procedure name),
so your command has no idea what it is supposed to do when you call an
execute method. You also haven't configured the command to know what
connection it should use. Don't take this the wrong way, but this is pretty
fundamental ADO.NET stuff. You should really spend some time at
msdn.microsoft.com or ASP.NET or pick up a book on ASP.NET/ADO.NET.
This is more like what you need:
Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=" &
Server.MapPath("relative path to your database here")
Dim con As New OleDb.OleDBConnection(conStr)
Dim cmdStr As String = "SQL Statement Here"
Dim cmd As New OleDb.OleDbCommand(cmdStr, con)
Dim retVal As Integer
Try
con.Open
retVal = cmd.ExecuteNonQuery
Catch ex As OleDBException
'Handle database exceptions here
Catch ex2 As Exception
'Handle other exceptions here
Finally
con.close
End Try
8) I have a frameset, that linked to several aspx pages. one of the tabs is 780px width, and is linked to aspx page. I need that the aspx page will be always 770px. I cannot see the contour of the width and height when I open the page, and I could find any automatic method that set always 770px in a new page. Can I make a default width & height, or is there any simple method to limit the size of any of the pages, and see immediatelly what happens on the parent frameset page ?
Web pages do not have a size at all, you can't set it the way you are
asking. It is up to you to make sure you do not put any content wider than
the boundry you don't wish to cross. The best way to do this is to create a
new, fresh, blank web page and place a 1 row, 1 column table on it that is
770px wide with the border turned off. Then, you build your web page inside
this table, making sure not to put anything into it that is wider than
770px.
9) I have an sln project, and for reason I don't know, now I cannot see the sources of html pages, in a single one page. What I see is only one of the sources of the pages (i.e main.htm) and I need each time to double click on the relevant page on the sln explorer, in oreder to see it. What's wrong.
It doesn't sound like anything is wrong. Each page should open up in its
own code window as you double click it from the Solution Explorer. They are
different files. Why would you expect to see the HTML from different files
in one page?
-Scott
Thanks a lot.
some clarifications : Any server side-code you write will be completed BEFORE the user ever gets the page to look at in their browser. Therefore, you should always open ...
Should I also close the connection on each ASPX page, or is it close
automatically ? Your code above does not create an instance of anything because the keyword "new" is not being used. Even if you had used it, you haven't configured your command's CommandText (like a SQL statement or stored procedure name), ...
Thank you.
My code was just fine (it was in the three dots)
What I did wrong, I see due your code :
I did :
call cmd.executeNoneQuery
instead of
retVal = cmd.executeNoneQuery.
That's all. Web pages do not have a size at all, you can't set it the way you are asking. It is up to you to make sure you do not put any content wider than ....
Thank you.
It doesn't sound like anything is wrong. Each page should open up in its own code window as you double click it from the Solution Explorer. They are different files. Why would you expect to see the HTML from different files in one page?
You understood me wrongly.
There should be a page-tab (like you see at bottom of each *.xls
excel-file).
What I see is not a page tab, that before I saw it.
Another things are my questions to dialog.
Also : I created a dialog, which is an aspx page.
How can I force "killing" from memory the dialogbox.
I have a problem that the calling form remember the dialogbox, and whenever
I open the dialog again,
I don't even get into the form_load event (before the if statement, of
course).
Also my questions about dialog-box have no answers yet :
Dialog-Box
---------------
2) I see that when I use dialog-box (by window.showModalDialog), and the
dialog is an aspx page - it opens a new session,
can I stay at the same session as before ?
(I see that parameter Session("aaa") which is known in the calling form, is
unknown at the called dialog box) ?
3) What is the command to close the dialog box ?
4) Dialog box has status bar - can I hide it ? can I put my own text on the
status bar (at the bottom line) ?
5) How can I do refresh to the calling form that called the dialogbox just
after it called it ? (calling form is an aspx page).
6) How can I return the window.dialogArguments, when the dialog-box is an
aspx page ?
Thanks :)
>> Any server side-code you write will be completed BEFORE the user ever gets the page to look at in their browser. Therefore, you should always open ... Should I also close the connection on each ASPX page, or is it close automatically ?
You should open it in each page, do the work you need to do and close it (no
it is not closed automatically [unless you are using a DataAdapter, which it
sounds like you are not]) on each page. Your code above does not create an instance of anything because the keyword "new" is not being used. Even if you had used it, you haven't configured your command's CommandText (like a SQL statement or stored procedure name), ... Thank you.
My code was just fine (it was in the three dots) What I did wrong, I see due your code : I did : call cmd.executeNoneQuery instead of retVal = cmd.executeNoneQuery. That's all.
Well, you said that you were getting an error and you didn't provide all
your code, so I assumed that what you did provide was all you wrote. My
retVal variable does not need to be included to prevent your error. It's
just there to get the return value (of how many records are affected by the
command). Web pages do not have a size at all, you can't set it the way you are asking. It is up to you to make sure you do not put any content wider than ....
Thank you.
It doesn't sound like anything is wrong. Each page should open up in its own code window as you double click it from the Solution Explorer. They are different files. Why would you expect to see the HTML from different files in one page?
You understood me wrongly. There should be a page-tab (like you see at bottom of each *.xls excel-file). What I see is not a page tab, that before I saw it.
Try going into Tools...Options and on the first section, hit the Reset
Window Layout button and look again.
Also my questions about dialog-box have no answers yet : Dialog-Box
I didn't answer the dialog box questions because I didn't understand them.
You have to remember that all the code in an .aspx page is server-side code.
That is, code that is processed on the server BEFORE the client recieves the
page. Generally speaking, you don't use dialog boxes on web pages. You use
them in a Windows Forms application.
Thank you for all your answers.
Except the dialog box, all answered were replied - thank you very much.
For the dialog-box :
In the asp page, I have linked a datagrid to a table (users).
The datagrid is called : dsUsers.
In the ItemDatabound event, I add the event of some of my edit button, to do
: open a dialog box.
(So, I persume this happens before the code is send to client,
and that's how on aspx, I call another aspx form, that is in a dialog box.
Also the code is web project, that is under the sln applications,
and under that project, there are pages, such as aspx, etc...,
so it is a web project, that I can run at the internet, isn't it ?)
Here is the code :
-----------------------
Private Sub dgUsers_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgUsers.ItemDataBound
Dim editBtn As LinkButton
Dim btn As Button
Dim s As String
If e.Item.ItemIndex <> -1 Then
If e.Item.ItemType = ListItemType.Item Or ListItemType.AlternatingItem Then
btn = CType(e.Item.Cells(0).Controls(0), Button)
s = e.Item.Cells(8).Text
btn.Attributes.Add("onclick", _
String.Format("window.showModalDialog('myAspPage.a spx?user_id=" & s & "',
'', 'dialogHeight:575 ;dialogWidth:600px;center=yes')"))
-----------
It also works, and open the dialog.
The related dialog box is for myAspPage.aspx.
The related caling aspx is myCallAsp.aspx.
Now, again let's return to the questions about dialog, I have asked.
Thanks :)
I think you are going about the Edit button incorrectly. There is no need
to register an event handler for a link button at all. Just add a Button
column to the DataGrid and your grid will respond to the edit linkButton's
click automatically with the EditCommand event handler. The grid will then
automatically switch into "edit mode" so the user can edit the data. There
is no need for a dialog box at all.
Here's the HTML for the DataGrid:
<asp:DataGrid id="DataGrid1" runat="server">
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton"
UpdateText="Update"
CancelText="Cancel"
EditText="Edit">
</asp:EditCommandColumn>
</Columns>
</asp:DataGrid>
And, here's the code-behind code to handle the clicking of the button:
Private Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
DataGrid1.EditCommand
End Sub
And yes, as I've said, ALL server-side code is execute BEFORE the client
(browser) ever gets anything. Also, if you have .aspx pages, then yes, you
are making a web application which runs over the Internet.
"Eitan" <no****@nospam.com> wrote in message
news:er**************@TK2MSFTNGP12.phx.gbl... Thank you for all your answers. Except the dialog box, all answered were replied - thank you very much.
For the dialog-box :
In the asp page, I have linked a datagrid to a table (users). The datagrid is called : dsUsers.
In the ItemDatabound event, I add the event of some of my edit button, to do : open a dialog box. (So, I persume this happens before the code is send to client, and that's how on aspx, I call another aspx form, that is in a dialog box. Also the code is web project, that is under the sln applications, and under that project, there are pages, such as aspx, etc..., so it is a web project, that I can run at the internet, isn't it ?)
Here is the code : -----------------------
Private Sub dgUsers_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgUsers.ItemDataBound Dim editBtn As LinkButton
Dim btn As Button
Dim s As String
If e.Item.ItemIndex <> -1 Then
If e.Item.ItemType = ListItemType.Item Or ListItemType.AlternatingItem Then
btn = CType(e.Item.Cells(0).Controls(0), Button)
s = e.Item.Cells(8).Text
btn.Attributes.Add("onclick", _
String.Format("window.showModalDialog('myAspPage.a spx?user_id=" & s & "', '', 'dialogHeight:575 ;dialogWidth:600px;center=yes')"))
-----------
It also works, and open the dialog. The related dialog box is for myAspPage.aspx. The related caling aspx is myCallAsp.aspx.
Now, again let's return to the questions about dialog, I have asked.
Thanks :)
> Here's the HTML for the DataGrid: <asp:DataGrid id="DataGrid1" runat="server"> <Columns> <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" ...
No !!!
I know that kind option, but I don't want to ...
I want to open a dialog box for kind of reason,
and I need the code behinds.
Why not just answer my several questions, as before.
Again (the same forgotten 6 questions) :
Dialog-Box
---------------
2) I see that when I use dialog-box (by window.showModalDialog), and the
dialog is an aspx page - it opens a new session,
can I stay at the same session as before ?
(I see that parameter Session("aaa") which is known in the calling form, is
unknown at the called dialog box) ?
3) What is the command to close the dialog box ?
4) Dialog box has status bar - can I hide it ? can I put my own text on the
status bar (at the bottom line) ?
5) How can I do refresh to the calling form that called the dialogbox just
after it called it ? (calling form is an aspx page).
6) How can I return the window.dialogArguments, when the dialog-box is an
aspx page ?
------
Thanks :)
I have told you why I haven't answered your dialog questions. Because I
don't have too much information about this particular method.
"ShowModelDialog" is an IE proprietary method of the client-side "window"
object. I don't use proprietary objects, properties and methods.
I can tell you that whenever you open a new browser window, you get a new
session. There is nothing you can do about that.
A simple msdn search reveals quite a bit of information
( http://msdn.microsoft.com/library/de...odaldialog.asp)
Among other things, this url explains how to pass data into this window.
In additon, the JavaScript command to close the current window is:
self.close()
"Eitan" <no****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Here's the HTML for the DataGrid:
<asp:DataGrid id="DataGrid1" runat="server"> <Columns> <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" ...
No !!! I know that kind option, but I don't want to ...
I want to open a dialog box for kind of reason, and I need the code behinds.
Why not just answer my several questions, as before. Again (the same forgotten 6 questions) :
Dialog-Box --------------- 2) I see that when I use dialog-box (by window.showModalDialog), and the dialog is an aspx page - it opens a new session, can I stay at the same session as before ? (I see that parameter Session("aaa") which is known in the calling form, is unknown at the called dialog box) ? 3) What is the command to close the dialog box ? 4) Dialog box has status bar - can I hide it ? can I put my own text on the status bar (at the bottom line) ? 5) How can I do refresh to the calling form that called the dialogbox just after it called it ? (calling form is an aspx page). 6) How can I return the window.dialogArguments, when the dialog-box is an aspx page ? ------
Thanks :)
"Scott M." <s-***@nospam.nospam> wrote in message
news:OO*************@TK2MSFTNGP12.phx.gbl... I have told you why I haven't answered your dialog questions. Because I don't have too much information about this particular method.
Well, say so.
I can tell you that whenever you open a new browser window, you get a new session. There is nothing you can do about that.
A simple msdn search reveals quite a bit of information (http://msdn.microsoft.com/library/de...odaldialog.asp)
Among other things, this url explains how to pass data into this window.
In additon, the JavaScript command to close the current window is: self.close()
Thanks :)
I'll go that link.
"Eitan" <no****@nospam.com> wrote in message
news:uN*************@TK2MSFTNGP09.phx.gbl... "Scott M." <s-***@nospam.nospam> wrote in message news:OO*************@TK2MSFTNGP12.phx.gbl...I have told you why I haven't answered your dialog questions. Because I don't have too much information about this particular method.
Well, say so.
I did. Just go back and look at my responses. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: michela rossi |
last post by:
Hi,
Don't know if anyone can help me. I've got the following questions:
1. Does anyone know of anywhere that offers shared webspace which has
support for Java/JSP? Ideally running Tomcat?
2. ...
|
by: Torsten Mohr |
last post by:
Hi,
i'd like to write an extension module and use
PyArg_ParseTuple in that to parse the parameters.
I have several questions related to this that i did
not find in the documentation:
1....
|
by: Victor Porton |
last post by:
Suppose I create several RSS channels:
http://example.com/company-news.rdf
http://example.com/new-products.rdf
http://example.com/product-updates.rdf
etc.
They are interrelated: for example,...
|
by: NotGiven |
last post by:
I have a form with several questions. Within each question there are
several checkboxes. I need to ensure that the user checks at least one
checkbox. They can check more but must check at least...
|
by: Ayende Rahien |
last post by:
I'm storing my data inside an XML file, the data is divided into several
niches.
I expect two things to happen during normal use of the application:
A> Number of niches to grow.
B> Amount of...
|
by: Chad A. Beckner |
last post by:
I am starting to work on implementing ASP.NET (using VS.NET Dev 2003) into
our current ASP 3.0 intranet setup. We have several (say 15 - 20)
"applications" that are run within our intranet, which...
|
by: Tiago Miguel Silva |
last post by:
Hi there to all.
I am a .NET Crystal newbie and I hope that you don’t pick me up much :) with
the following questions:
1) It’s possible to access the report model to alter the rendered...
|
by: Byron |
last post by:
I have several user controls that have a few methods in common, such
LoadFromForm() which populates an object from controls on the form. I want
to call that method from the form in which the...
|
by: Joe |
last post by:
Dear all,
I have many questions, please help!
1.) If i use the backup/restore function in the IIS, does the backup
includes only the register and settings of web sites in the IIS only, or does
it...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
| |