Hi,
You can use this:
CREATE VIEW vRandNumber
AS
SELECT ROUND(((100 - 0 -1) * RAND() + 0), 0) as RandNumber
CREATE FUNCTION RandNumber()
RETURNS float
AS
BEGIN
RETURN (SELECT RandNumber FROM vRandNumber)
END
select dbo.RandNumber()
from dbo.Product
You need to use a function...
It's logical to decide that 0 or 1 value at inserting, but it doesn't really matter.
Essentially this is the most important part:
select
CASE
WHEN count([ref]) > 0 THEN 0
ELSE 1
END
from [SandBox].[dbo].[UniqueBookingRef]
WHERE ref = 'L01'
That's the logic that...
Hi,
insert into [SandBox].[dbo].[UniqueBookingRef]
select
'L01'
,
CASE
WHEN count([ref]) > 0 THEN 0
ELSE 1
END
from [SandBox].[dbo].[UniqueBookingRef]
WHERE ref = 'L01'
The first time you enter L01, you will get 1, any new attempts will get 0
Hi,
A few quick pointers:
a) Don't use exists
It's horribly slow because you're working with a massive (relative or actual) collection of data, only to give you a yes or no. Instead, create that yes or no yourself like this:
when 0 < (select count(case_id) from def d1 where d1.case_id =...
So you're trying to find out which Excel version is installed on the user's computer?
This would do that:
public string Read(string KeyName)
{
RegistryKey baseKey = Registry.ClassesRoot;
RegistryKey subKey = baseKey.OpenSubKey(@"Excel.Application\CurVer");
if (subKey == null)...
It all depends on what that executable is supposed to do. But, the whole set-up sounds fishy.
Still, "If it's not broken, don't fix it", especially if it does it in a performant and managable way.
Perhaps you can gradually incorporate the executable's logic into the webservice and make it...
Hi,
Check this link about the 'XML Bulk Load component':
http://support.microsoft.com/kb/316005
Should be pretty easy considering the low complexity of your XML file.
Indeed there should be a "code behind" page* containing something like this:
dgNames.Datasource = someSource;
dgNames.DataBind();
If you don't have it, it means the aspx inherits from a class defined within a dll, available within the bin directory within the website's directory. But you...
Hi,
I will need to implement a website-search system of some complexity very soon, and I'm researching what my options are.
Ofcourse, that means either develop it myself, or buy a third party solution. Unless it's easy to do (which I doubt, considering the scale of the website in question), I...
I had one using style, previously, but I removed it. That didn't change anything though.
This is the asp code I have now:
<asp:DropDownList ID="DdlID" runat="server" AutoPostBack="False" OnSelectedIndexChanged="DdlID_SelectedIndexChanged">
</asp:DropDownList>
Hi,
I'm populating an asp:DropDownList from a DataSet, and I get a very weird result.
I have this number (0099471468240) that gets shown like this: ' 009... ', within the dropdown. Although in code, it clearly is what it should be: 0099471468240.
Now the weird thing is that it works...
Hi,
We (the development team) get a re-occuring occassional error:
Error : System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.OleDb.OleDbException: Could not find stored procedure 'sp_***'. (pageinfo ...) --- End of inner exception stack trace...
Hi,
Which controls within ASP.net can contain, and display, a Bitmap object, other than the Response.Outputstream (ie, the page itself)?
I'm doing some GDI+ drawing on a Bitmap object, which I like to pass to a valid receiver.
It would make sense to me that for instance an asp:image can...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.