Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Tuesday, March 27, 2012

Able to connect via local host but not server

I have a page that connects to SQL server. It works fine when running in local host but when I publish to the server, I get the following:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Any ideas on where to start?

Thanks,

Mark

Try these two blog posts:

http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx

Sunday, March 25, 2012

A4/Landscape printing problem

Hi,
I got a report with page Width 11.6 and Height 8.2 and Body Width 11.1 and
all margins are 0.25.
I want to print it in A4 landscape format. Unfortunately if I set for
default printer HP Desk Jet printer it prints as A4/Landscape correctly, but
if I set for default printer any HP LaserJet printer it tries to print in
Letter/Landscape format and of course it prints empty pages after every page.
I use direct print, SQL2005 Reports
Is there a way to set the printer page Letter or A4? Or to set up all
reports to print at A4 not Letter format?
ThanksHi Ivailo,
it seems that standard settings to printers are to be configured via Control
Panel/Printers and Faxes/<your printer>/Printing Preferences
And this to be repeated for each and any printer.
Saludos, Henrique

A4 Page Size settings

How can I set a default of A4 Page Size for my Reports?
--
Rae GOn Feb 12, 9:03 am, RaeG <R...@.discussions.microsoft.com> wrote:
> How can I set a default of A4 Page Size for my Reports?
> --
> Rae G
Go to the report properties, you can set the default height and width
at portion called InteractiveSize, don't forget to same height and
width at the PageSizesql

Thursday, March 22, 2012

A way to add .Net classes in a report?

I know that subject line might be a little confusing - -
I have a project with a .vb class, that, when accessing a web page, based on
the user's login, I grab their Employee ID. With that, I can conceivably
create a method to get a list of employees who report to that person
Is there a way to include a .vb class in a report project, and then, access
a particular method (in this case, getting the list of direct reports), in
the document map?Elmo,
I have done something similar. You should be able to create a reportviewer
in an aspx page and access your class in the aspx code...pass the subsequent
values to the report.
billN
--
Message posted via http://www.sqlmonster.com|||Will I be able to use the same report file (.rdl) that I designed in a
Report Server Project in BI?
I tried adding a .rdl file to a ReportViewer control one time, and it wasn't
recognized.
"wnichols via SQLMonster.com" <u3357@.uwe> wrote in message
news:7e587ee1771a4@.uwe...
> Elmo,
> I have done something similar. You should be able to create a
> reportviewer
> in an aspx page and access your class in the aspx code...pass the
> subsequent
> values to the report.
> billN
> --
> Message posted via http://www.sqlmonster.com
>

Monday, March 19, 2012

A temporary database

I have three aspx pages with one form in every page, these three pages allows to register a user. Now when I submit every form on every page the data is sent to the database, but somebody has recommended me to store data in a temporary database file, and when user submit last page (form) store all the data in main database.

I use Sql 2000 Server Personal Edition and VB.NET for aspx pages.
How can I use this temporary database in my aspx page?

Now my first form-page:


<%@.Import Namespace="System.Data" %>
<%@.Import Namespace="System.Data.SqlClient" %
<script language="VB" runat="server">
Dim strConnection As New SqlConnection(ConfigurationSettings.AppSettings("myConn"))

Sub Send_data(sender As Object, e As EventArgs)

Dim CmdInsert As New SqlCommand("new_user1", strConnection)
CmdInsert.CommandType = CommandType.StoredProcedure

Dim InsertForm As New SqlDataAdapter()
InsertForm.InsertCommand = CmdInsert

CmdInsert.Parameters.Add("@.Id", SqlDbType.bigint)
CmdInsert.Parameters("@.Id").Direction = ParameterDirection.Output

CmdInsert.Parameters.Add(New SqlParameter("@.e_mail", SqlDbType.varchar, 50, "e_mail"))
CmdInsert.Parameters("@.e_mail").Value = mail.Text()
……….

strConnection.open()
CmdInsert.ExecuteNonQuery
Dim IdUser As integer = CmdInsert.Parameters("@.Id").Value
strConnection.close()

End Sub

Thanks(1) you can generate an id for each user
(2) insert all the data from each page into some temp database( which you have already created ) using the id
(3) finally call some stored proc tht will move all the info from the temp db to the main one..again using the id...if the user decides to cancel ( at any stage) just empty the temp table.

hth|||Could you recommend me an article, manual, reference,etc.. to start with temporary databases please? I have never worked with them.|||its just another table thts xactly similar in structure to your actual table that you want to put the records in..there are some sys temp tables but i was referring to user created table...sorry if i misled you..

hth|||Before I take the decision of using 'temp tables' I want to know, sure, if it is better passing all the values of the forms with a session variable through the pages until the end, and then do the insert into the main (real) database, or if it is better to do the inserts in every page and use 'temp tables'. Or do the inserts in every page and store the userName and Password in a session variable and do the insert of these 'key' fields in the last page when the registration is complete.

Some experienced ideas please?|||It depends upon the amount of data. Will have have 100 bytes of data over the screens, or 20000 bytes? If 100 bytes, session will be fine, if 20000 then probably not. In addition, rather than using a temp table, you might just want to add a "pending" flag in the real table, and the add data as you go along (with pending set to true) and then on the last page, save last of the data and clear the pending flag.|||I don' t know exactly the amount of data, it is more or less ten fields per page (3 pages). Five with number values and five with text values with max length 50, and some text area field.
Anyway, regardless of the amount of data, Is it better to use a 'pending' flag in the real table? Now I don' t know anything about this system.

Thanks,
Cesar|||I tend to prefer it, as it saves some rewriting of data. Are you already using the Session for other things? If so, it might be reasonable to add this information and then not persist anything in the DB until they are done. With either other plan, you need to have a way to clean up junk (Pending in live or records in the temp).|||Every character is one byte, isn' t it? In afirmative case the amount of data per page will be less than 200 bytes.|||Ok thank you very much|||.NET uses Unicode, so each character in a string is 2 bytes. Either 200 or 400 bytes would be reasonable for the session, unless you have thousands of users, or unless you want to avoid using the session for other reasons.

A temporary database

Hi !

I use Sql 2000 Server as a database and an ASP.NET application with VB.NET language.

Now I am working with three pages with one form in every page that allows to register a user. To accomplish the registration the user needs to fill all the three pages, but now I am sending the data to the database in every page, so if a user leaves the process before reaching the third page it will have an invalid user entry into the database that I don t want. To avoid this I was recommended to store the in a temporary database file. I have been searching information about this but I have not found it.

Somebody can help me finding the necessary documentation to achieve it please?

ThanksOriginally posted by cesark29
Hi !

I use Sql 2000 Server as a database and an ASP.NET application with VB.NET language.

Now I am working with three pages with one form in every page that allows to register a user. To accomplish the registration the user needs to fill all the three pages, but now I am sending the data to the database in every page, so if a user leaves the process before reaching the third page it will have an invalid user entry into the database that I don t want. To avoid this I was recommended to store the in a temporary database file. I have been searching information about this but I have not found it.

Somebody can help me finding the necessary documentation to achieve it please?

Thanks

I have not worked on asp or any other front ends but what i feel is, u should hold all the data in these previous pages in some hidden variables or something and pass it when the user completes the whole registration process.|||I know that passing the data from one page to another is an option, but I think that is better to pass the minimum data as you can between pages. Anyway if you think that is a good option explain me in which cases a temporary database is used.

Thanks !|||Originally posted by cesark29
I know that passing the data from one page to another is an option, but I think that is better to pass the minimum data as you can between pages. Anyway if you think that is a good option explain me in which cases a temporary database is used.

Thanks !
using database for storing these values will make the page slower since it will have to go to the database three times.Instead, it is very common to use sessions for such scenarios.
Regarding temperory databases, they are used internally to hold temperory tables and temperory stored procedures.they are used to store any work tables or temperory tables used while processing
to know more about the temp database check out BOL under System databases and data.|||Good harshal, thank you very much.

Sunday, March 11, 2012

A single group spanning pages...

Is there any way to identify if a group is going to be split between pages?
I basically want to put a
"product XXX continued on next page..." at the bottom of the page if the
group is going to be split. Thanks in advance.
MichaelOn May 18, 10:10 am, Michael C <Micha...@.discussions.microsoft.com>
wrote:
> Is there any way to identify if a group is going to be split between pages?
> I basically want to put a
> "product XXX continued on next page..." at the bottom of the page if the
> group is going to be split. Thanks in advance.
> Michael
As far as I know, there is not; however, you could try using an
expression like follows to group by:
=Ceiling(RowNumber(Nothing)/NumberOfRowsPerPage)
And then set the table/matrix control to start each group on a new
page. Then you could check to determine how many rows are in the
dataset and divide those by NumberOfRowsPerPage to determine
(possibly) the number of pages to put the message on. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||http://blogs.msdn.com/chrishays/archive/2006/09/27/ContinuedHeader.aspx
"Michael C" wrote:
> Is there any way to identify if a group is going to be split between pages?
> I basically want to put a
> "product XXX continued on next page..." at the bottom of the page if the
> group is going to be split. Thanks in advance.
> Michael
>

Tuesday, March 6, 2012

a SELECT statment, please help me

hello,

i have a page "Picture.aspx?PictureID=4"

i have a FormView witch shows details about that picture and uses a stored procedure with input parameter the "@.PictureID" token from query string

the Pictures table has among other rows "PictureID", "UserID" - uniqueidentifier - from witch user the picture belongs to

i have a second FormView on the same page, witch should show "other pictures from the same user" and uses a Stored Procedure

how should i write that stored procedure...frist to take the UserID from the picture with PictureID=4, then to pass it as input parameter and select the pictures witch has as owner the user with that UserID, and if can be done, to avoid showing the PictureID=4 again

a solution should be to add at querry the UserID too, but i want to avoid that

any sugestion is welcomed, please help me

THANKS

CREATE PROCEDURE GetPictures
@.UserId uniqueidentifier,
@.DisplayedPictureId int
AS
BEGIN
SELECT * FROM Pictures
WHERE UserId = @.UserId AND PictureID <> @.DisplayedPictureId
END

|||

hey, thanks for code

the DisplayedPictureId i take it from querry string, but how should i take the UserId trying to avoid puting it on querry string too

i heard something about Sesion or Cookie, is it good, but how should i use that?

|||

If you are using asp.net membership you can use Membership.GetUser().ProviderUserKey.ToString() to get UserId for logged in users.

|||

yes, but a visitor is not the "owner" of the picture...and the page is public to anonymous visitors too

|||

hey, i figured out how to do that

i save the UserId in a hiddenField (from the first formView) and then i use it as input parameter to second formView

thanks for help

Saturday, February 25, 2012

A question of Sum

Hi,
how can I retrieve the sum till the end of each page and put it in the end
of corresponding page?
Ex: Page1 Page 2
10 40
20 50
30 60
Sum: 60 Sum: 60 (from the previous page) + 150 = 210
Any help would be appreciated.You do not know when paging occurs, expect by having groups break on a
page... SO you would create groups and do the sums in the group footers,
breaking each group on a new page...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Goncalo" <Goncalo@.discussions.microsoft.com> wrote in message
news:125001F8-B57C-4CC2-A7D7-750FECE57E69@.microsoft.com...
> Hi,
> how can I retrieve the sum till the end of each page and put it in the end
> of corresponding page?
> Ex: Page1 Page 2
> 10 40
> 20 50
> 30 60
> Sum: 60 Sum: 60 (from the previous page) + 150 => 210
> Any help would be appreciated.
>|||Thanks for answering the question...
but i still have the same problem when groups expand to more then 1 page,
right?
Goncalo
"Wayne Snyder" wrote:
> You do not know when paging occurs, expect by having groups break on a
> page... SO you would create groups and do the sums in the group footers,
> breaking each group on a new page...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Goncalo" <Goncalo@.discussions.microsoft.com> wrote in message
> news:125001F8-B57C-4CC2-A7D7-750FECE57E69@.microsoft.com...
> > Hi,
> > how can I retrieve the sum till the end of each page and put it in the end
> > of corresponding page?
> >
> > Ex: Page1 Page 2
> > 10 40
> > 20 50
> > 30 60
> >
> > Sum: 60 Sum: 60 (from the previous page) + 150 => > 210
> >
> > Any help would be appreciated.
> >
>
>

A question about varchar parameters

I've created a stored procedure that takes a varchar(10) as a parameter. However calling this stored procedure from an ASP page, with a string of greater length, generates an error. However this does not happen in Query Analyzer (it simply truncates the string to 10 characters). I was under the previous impression that this truncation was implicit, but now it seems that it is not. Can someone please give me a quick overview of how to work around this issue (is there an SQL setting I can flip on). I know I could pre-truncate every value in my page, but that seems like a design nightmare (seeing as how I would need to know the size of every varchar parameter in every stored procedure old and new, also I'd like to be able to simply increase the size of the data field in the table, at a later point, without having to match it up in every stored procedure and ASP page ).

P.S. I am using SQL Sever 2000

How did you call the stored procedure from your code? I use SqlConnection and SqlCommand to call the sp with a Parameter, it succeeded even I input a string with length greater then the length defined for the stored procedure parameter, as what happened in Query Analyzer.

So I guess your exception came from ASP .NET, not SQL. Did you call the stored procedure using OleDbCommand and specify the length for the parameter on the application side?