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

Monday, March 26, 2012

help with Benchmark

Hi guys!! does any one know a page at microsoft.com or another site that has
the time sql 2005 takes to insert a row ?
i saw at microsfot.com some benchmarks but based on transactions and
comparing Sql with Oracle and IBM, that's not what i'm looking for, i'm
looking for times in mili seconds or micro seconds Sql takes to do it
Thanks!!
No, that information isn't available from Microsoft (and it would be a
license violation for anyone else to publish it without Microsoft's
permission). One major reason is that you have to say under what
conditions. Is it in a user-defined transaction or not? How many indexes
of what type? Do you need to split a b-tree node? Are there concurrent
users? Are there any conflicts? blah blah blah. In other words, it's not
a useful number in this day and age. Now if there were a standardized
benchmark that gave this information it might be interesting, in the context
of that benchmark. Old benchmarks like Wisconsin used to do some of this
(though it was more query than insert/update focused). But most such
benchmarks are no longer published.
You might find some data in comparisons the MySQL folks publish as they (a)
try to make themselves look good by focusing on single-statement comparisons
rather than complex application comparisons and (b) they don't seem to mind
violating Microsoft (and others') license agreements. At least that was the
situation when I looked a couple of years ago.
Hal Berenson, President
PredictableIT, LLC
http://www.predictableit.com
"Rick" <elmargaro@.hotmail.com> wrote in message
news:OMlF5gCVGHA.5808@.TK2MSFTNGP12.phx.gbl...
> Hi guys!! does any one know a page at microsoft.com or another site that
> has the time sql 2005 takes to insert a row ?
> i saw at microsfot.com some benchmarks but based on transactions and
> comparing Sql with Oracle and IBM, that's not what i'm looking for, i'm
> looking for times in mili seconds or micro seconds Sql takes to do it
> Thanks!!
>
>
|||oki doki, thanks Hal, i'll look for some comparisons.
Regards.
"Hal Berenson" <hberenson@.scalabilityexperts.com> escribi en el mensaje
news:eSysFQJVGHA.4864@.TK2MSFTNGP12.phx.gbl...
> No, that information isn't available from Microsoft (and it would be a
> license violation for anyone else to publish it without Microsoft's
> permission). One major reason is that you have to say under what
> conditions. Is it in a user-defined transaction or not? How many indexes
> of what type? Do you need to split a b-tree node? Are there concurrent
> users? Are there any conflicts? blah blah blah. In other words, it's
> not a useful number in this day and age. Now if there were a standardized
> benchmark that gave this information it might be interesting, in the
> context of that benchmark. Old benchmarks like Wisconsin used to do some
> of this (though it was more query than insert/update focused). But most
> such benchmarks are no longer published.
> You might find some data in comparisons the MySQL folks publish as they
> (a) try to make themselves look good by focusing on single-statement
> comparisons rather than complex application comparisons and (b) they don't
> seem to mind violating Microsoft (and others') license agreements. At
> least that was the situation when I looked a couple of years ago.
> --
> Hal Berenson, President
> PredictableIT, LLC
> http://www.predictableit.com
>
> "Rick" <elmargaro@.hotmail.com> wrote in message
> news:OMlF5gCVGHA.5808@.TK2MSFTNGP12.phx.gbl...
>

help with Benchmark

Hi guys!! does any one know a page at microsoft.com or another site that has
the time sql 2005 takes to insert a row '
i saw at microsfot.com some benchmarks but based on transactions and
comparing Sql with Oracle and IBM, that's not what i'm looking for, i'm
looking for times in mili seconds or micro seconds Sql takes to do it
Thanks!!No, that information isn't available from Microsoft (and it would be a
license violation for anyone else to publish it without Microsoft's
permission). One major reason is that you have to say under what
conditions. Is it in a user-defined transaction or not? How many indexes
of what type? Do you need to split a b-tree node? Are there concurrent
users? Are there any conflicts? blah blah blah. In other words, it's not
a useful number in this day and age. Now if there were a standardized
benchmark that gave this information it might be interesting, in the context
of that benchmark. Old benchmarks like Wisconsin used to do some of this
(though it was more query than insert/update focused). But most such
benchmarks are no longer published.
You might find some data in comparisons the mysql folks publish as they (a)
try to make themselves look good by focusing on single-statement comparisons
rather than complex application comparisons and (b) they don't seem to mind
violating Microsoft (and others') license agreements. At least that was the
situation when I looked a couple of years ago.
Hal Berenson, President
PredictableIT, LLC
http://www.predictableit.com
"Rick" <elmargaro@.hotmail.com> wrote in message
news:OMlF5gCVGHA.5808@.TK2MSFTNGP12.phx.gbl...
> Hi guys!! does any one know a page at microsoft.com or another site that
> has the time sql 2005 takes to insert a row '
> i saw at microsfot.com some benchmarks but based on transactions and
> comparing Sql with Oracle and IBM, that's not what i'm looking for, i'm
> looking for times in mili seconds or micro seconds Sql takes to do it
> Thanks!!
>
>|||oki doki, thanks Hal, i'll look for some comparisons.
Regards.
"Hal Berenson" <hberenson@.scalabilityexperts.com> escribi en el mensaje
news:eSysFQJVGHA.4864@.TK2MSFTNGP12.phx.gbl...
> No, that information isn't available from Microsoft (and it would be a
> license violation for anyone else to publish it without Microsoft's
> permission). One major reason is that you have to say under what
> conditions. Is it in a user-defined transaction or not? How many indexes
> of what type? Do you need to split a b-tree node? Are there concurrent
> users? Are there any conflicts? blah blah blah. In other words, it's
> not a useful number in this day and age. Now if there were a standardized
> benchmark that gave this information it might be interesting, in the
> context of that benchmark. Old benchmarks like Wisconsin used to do some
> of this (though it was more query than insert/update focused). But most
> such benchmarks are no longer published.
> You might find some data in comparisons the mysql folks publish as they
> (a) try to make themselves look good by focusing on single-statement
> comparisons rather than complex application comparisons and (b) they don't
> seem to mind violating Microsoft (and others') license agreements. At
> least that was the situation when I looked a couple of years ago.
> --
> Hal Berenson, President
> PredictableIT, LLC
> http://www.predictableit.com
>
> "Rick" <elmargaro@.hotmail.com> wrote in message
> news:OMlF5gCVGHA.5808@.TK2MSFTNGP12.phx.gbl...
>

help with Benchmark

Hi guys!! does any one know a page at microsoft.com or another site that has
the time sql 2005 takes to insert a row '
i saw at microsfot.com some benchmarks but based on transactions and
comparing Sql with Oracle and IBM, that's not what i'm looking for, i'm
looking for times in mili seconds or micro seconds Sql takes to do it
Thanks!!No, that information isn't available from Microsoft (and it would be a
license violation for anyone else to publish it without Microsoft's
permission). One major reason is that you have to say under what
conditions. Is it in a user-defined transaction or not? How many indexes
of what type? Do you need to split a b-tree node? Are there concurrent
users? Are there any conflicts? blah blah blah. In other words, it's not
a useful number in this day and age. Now if there were a standardized
benchmark that gave this information it might be interesting, in the context
of that benchmark. Old benchmarks like Wisconsin used to do some of this
(though it was more query than insert/update focused). But most such
benchmarks are no longer published.
You might find some data in comparisons the MySQL folks publish as they (a)
try to make themselves look good by focusing on single-statement comparisons
rather than complex application comparisons and (b) they don't seem to mind
violating Microsoft (and others') license agreements. At least that was the
situation when I looked a couple of years ago.
--
Hal Berenson, President
PredictableIT, LLC
http://www.predictableit.com
"Rick" <elmargaro@.hotmail.com> wrote in message
news:OMlF5gCVGHA.5808@.TK2MSFTNGP12.phx.gbl...
> Hi guys!! does any one know a page at microsoft.com or another site that
> has the time sql 2005 takes to insert a row '
> i saw at microsfot.com some benchmarks but based on transactions and
> comparing Sql with Oracle and IBM, that's not what i'm looking for, i'm
> looking for times in mili seconds or micro seconds Sql takes to do it
> Thanks!!
>
>|||oki doki, thanks Hal, i'll look for some comparisons.
Regards.
"Hal Berenson" <hberenson@.scalabilityexperts.com> escribió en el mensaje
news:eSysFQJVGHA.4864@.TK2MSFTNGP12.phx.gbl...
> No, that information isn't available from Microsoft (and it would be a
> license violation for anyone else to publish it without Microsoft's
> permission). One major reason is that you have to say under what
> conditions. Is it in a user-defined transaction or not? How many indexes
> of what type? Do you need to split a b-tree node? Are there concurrent
> users? Are there any conflicts? blah blah blah. In other words, it's
> not a useful number in this day and age. Now if there were a standardized
> benchmark that gave this information it might be interesting, in the
> context of that benchmark. Old benchmarks like Wisconsin used to do some
> of this (though it was more query than insert/update focused). But most
> such benchmarks are no longer published.
> You might find some data in comparisons the MySQL folks publish as they
> (a) try to make themselves look good by focusing on single-statement
> comparisons rather than complex application comparisons and (b) they don't
> seem to mind violating Microsoft (and others') license agreements. At
> least that was the situation when I looked a couple of years ago.
> --
> Hal Berenson, President
> PredictableIT, LLC
> http://www.predictableit.com
>
> "Rick" <elmargaro@.hotmail.com> wrote in message
> news:OMlF5gCVGHA.5808@.TK2MSFTNGP12.phx.gbl...
>> Hi guys!! does any one know a page at microsoft.com or another site that
>> has the time sql 2005 takes to insert a row '
>> i saw at microsfot.com some benchmarks but based on transactions and
>> comparing Sql with Oracle and IBM, that's not what i'm looking for, i'm
>> looking for times in mili seconds or micro seconds Sql takes to do it
>> Thanks!!
>>
>sql

Help with an SQL SELECT statement in ASP page

I have built this SQL statement which should
create the RS I need.

strSQL1 = "SELECT [INVENTRY MASTER].BOX_NO FROM [INVENTRY MASTER] WHERE
Left([INVENTRY MASTER].BOX_NO, PatIndex('%821%', [INVENTRY MASTER].BOX_NO) -
1) NOT LIKE '%[1-9]%' AND [INVENTRY MASTER].BOX_NO LIKE '%821%';"

This Line:

objRS1.Open strSQL1, objConn

Causes this error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid length parameter
passed to the substring function.

I have searched google, and found reference to the error meaning it found a
space in the first position. I tried adding LTRIM into my statement to cure
it but it made no difference, I may be barking up the wrong tree so to speak
;) but I cant find any other information on it.

If anyone has any ideas why this statement does not work I'd be very
grateful, the project has to be completed today, and this is the last thing
to get working now!

Ta

Paul McGuireThe length parameter in your LEFT(String, Length) function is

PatIndex('%821%', [INVENTRY MASTER].BOX_NO) - 1

PatIndex can return 0, if your string '821' isn't part of your BOX_NO, which makes the length = -1, which isn't allowed as a valid length. Your additional condition does not help, since the expression as a whole will be evaluated.

Consider to use a view to put your conditon
[INVENTRY MASTER].BOX_NO LIKE '%821%'|||Let me expand on what I am trying to achieve to see if you can help further.

imagine a table collumn

BOX_NO
--------
JHIS 0000821
JHIS 0000821a
JHIS 0000821b
JHIS 00821
JHIS 00821a
JHIS 0001821
JHIS 0001821a
JHIS 0001821b
JHIS 01821
JHIS 01821a

A user on the internet page I am writing will enter 821 because he wants a list of the boxes:

JHIS 0000821
JHIS 0000821a
JHIS 0000821b
JHIS 00821

The JHIS is the users account number the leading 0's can vary which is what has caused the need to use PatIndex in the way which I have? Is there another way?

All the user knows is box number JHIS 0000821 is box number 821 if he wanted JHIS 0001821 he would enter 1821 and expect to get these boxes returned:

JHIS 0001821
JHIS 0001821a
JHIS 0001821b
JHIS 01821
JHIS 01821a

Any ideas on the best way to do this? Am i on the right lines?|||Why not just

WHERE BOX_NO LIKE '%0821%'

?|||erm I am not sure :) I will put this in now... it seems like this may work if I just add a proceeding '0' to what has been inputted and do a LIKE

If this works I'm going to be very embarrised but pleased to because its been bugging me for hours!

I will let you know if this solves the issue|||Thank You very much! I obviously could not see the wood for the trees!

I changed it slightly because as it stood if 821 was entered 0008210 returned aswell which was not wanted.

by changing the last % to a [a-z] and adding an OR and just looking for %0821 I get back exactly what I need. And its a nice simple select statement!

So I offer you a big thanks and a :) this should keep the managment happy!|||You are welcome.sql

Wednesday, March 21, 2012

Help with a simple Query

I am trying to make a single display page for an author's books.

the books page only displays books of a type "type" (novels, non-fiction, etc)

I would like to make it so that it can also show all books if "type" isn't selected. I THOUGHT the string would look like this:

<asp:SqlDataSource ID="SqlDSBooks" runat="server" ConnectionString="<%$ ConnectionStrings:csK2Reader%>" SelectCommand="SELECT * FROM [Books] ( If @.Type <> "" then WHERE ([Type] = @.Type)) ORDER BY [SortDate] DESC">

But it doesn't seem to want to work. I get a "server tag is not well formed" error.

Try this:

SELECT*FROM [Books]WHERE (@.TypeISNULLOR [Type]=@.Type)ORDERBY [SortDate]DESC

|||

Or, for text variables:

SELECT*FROM [Books]WHERE [Type] like IsNull(@.Type,'%')ORDERBY [SortDate]DESC

That is not, by the way, an exact equivalent of the previous poster's query.

This version allows a wildcard search, whereas the other query requires an exact match.

For example, if you were wanting to search for both Novels and Novellas, a value for @.Type of 'Novel%' would get you both types of book in one query.

Numbers and dates don't work this way. :(

Monday, March 12, 2012

Help with "enableEventValidation"

The "enableEventValidation" feauture is new for .Net 2.0

When I had a page that called back to itself through the use of a pushbutton, I recieved an error stating:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I went into my web.config file and inserted the following as suggested by microsoft:

<system.web>
<pages enableEventValidation="true" />
</system.web>

Now the error has gone away, however, the whole point of this particular page is to allow me to edit a row in a datagrid. When I click on the edit button, the page is called back to itself but I the chosen row (and none of the page for that matter) is availible to be edited.

Any ideas on what I am doing wrong? I want to call back the page so that I can edit the row that I chose by clicking on that row's "edit" button.

Here is the actual code from my page:

<%@. Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@. Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet
id="dsParts"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_PartsAreUs"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_PartsAreUs"] %>'
CommandText='<%# "SELECT * FROM dbo.Parts" %>'
Debug="true"
>
<EditOps>
<EditOpsTable Name="dbo.Parts" />
<Parameter Name="Name" Type="VarChar" />
<Parameter Name="Description" Type="NVarChar" />
<Parameter Name="Price" Type="Money" />
<Parameter Name="PartID" Type="Int" IsPrimary="true" />
</EditOps>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form runat="server">
<asp:DataGrid id="dgParts"
runat="server"
AllowSorting="False"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
ShowFooter="false"
ShowHeader="true"
DataSource="<%# dsParts.DefaultView %>"
PagerStyle-Mode="NextPrev"
DataKeyField="PartID"
onCancelCommand="dsParts.OnDataGridCancel"
onEditCommand="dsParts.OnDataGridEdit"
onUpdateCommand="dsParts.OnDataGridUpdate"
onItemDataBound="dsParts.OnDataGridItemDataBound"
>
<HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<Columns>
<asp:EditCommandColumn
ButtonType="PushButton"
CancelText="Cancel"
EditText="Edit"
HeaderText="Edit"
UpdateText="Update"
Visible="True"/>
<asp:BoundColumn DataField="PartID"
HeaderText="PartID"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="Name"
HeaderText="Name"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Description"
HeaderText="Description"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Price"
HeaderText="Price"
ReadOnly="false"
Visible="True"/>
</Columns>
</asp:DataGrid>
</form>
</body>
</html>

Check here:

http://aspalliance.com/146_Editing_a_DataGrid_Control

Buck Woody

Help with "enableEventValidation"

The "enableEventValidation" feauture is new for .Net 2.0

When I had a page that called back to itself through the use of a pushbutton, I recieved an error stating:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I went into my web.config file and inserted the following as suggested by microsoft:

<system.web>
<pages enableEventValidation="true" />
</system.web>

Now the error has gone away, however, the whole point of this particular page is to allow me to edit a row in a datagrid. When I click on the edit button, the page is called back to itself but I the chosen row (and none of the page for that matter) is availible to be edited.

Any ideas on what I am doing wrong? I want to call back the page so that I can edit the row that I chose by clicking on that row's "edit" button.

Here is the actual code from my page:

<%@. Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@. Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet
id="dsParts"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_PartsAreUs"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_PartsAreUs"] %>'
CommandText='<%# "SELECT * FROM dbo.Parts" %>'
Debug="true"
>
<EditOps>
<EditOpsTable Name="dbo.Parts" />
<Parameter Name="Name" Type="VarChar" />
<Parameter Name="Description" Type="NVarChar" />
<Parameter Name="Price" Type="Money" />
<Parameter Name="PartID" Type="Int" IsPrimary="true" />
</EditOps>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form runat="server">
<asp:DataGrid id="dgParts"
runat="server"
AllowSorting="False"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
ShowFooter="false"
ShowHeader="true"
DataSource="<%# dsParts.DefaultView %>"
PagerStyle-Mode="NextPrev"
DataKeyField="PartID"
onCancelCommand="dsParts.OnDataGridCancel"
onEditCommand="dsParts.OnDataGridEdit"
onUpdateCommand="dsParts.OnDataGridUpdate"
onItemDataBound="dsParts.OnDataGridItemDataBound"
>
<HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<Columns>
<asp:EditCommandColumn
ButtonType="PushButton"
CancelText="Cancel"
EditText="Edit"
HeaderText="Edit"
UpdateText="Update"
Visible="True"/>
<asp:BoundColumn DataField="PartID"
HeaderText="PartID"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="Name"
HeaderText="Name"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Description"
HeaderText="Description"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Price"
HeaderText="Price"
ReadOnly="false"
Visible="True"/>
</Columns>
</asp:DataGrid>
</form>
</body>
</html>

Check here:

http://aspalliance.com/146_Editing_a_DataGrid_Control

Buck Woody