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
...and d1.warrant_request_flg = 'N'
(Sql server syntax)
That way you can use that variable directly:
when 0 < @case_id_cnt then 1
c) Don't use count(*)
As you may have noticed, I replaced the count with count(d1.case_id). It's better to use a field for a count, preferably an indexed one.
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...
...Server was unable to process request. ---> System.Data.OleDb.OleDbException: Could not find stored procedure 'sp_***'. (pageinfo ...) --- End of inner exception stack trace ---
All signs indicate that everything is ok, except that it sometimes just doesn't seem able to connect. When that...
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...
Hi,
Am I correct saying that with ASP.Net, a static class, is basically a single server object, that is active across sessions?
Meaning that if I set a value of a static class, all sessions will read the same value. But that means that if one user's session sets this value again with something...
Hi,
I have a Web service with basic authentication active on IIS, to which I pass a NetworkCredential object:
NetworkCredential objCredential = new NetworkCredential("UID", "PWD");
myWebserviceObject.Credentials = objCredential;
On my local test solution, everything works fine.
Yet, on...
Nevermind, I found the solution.
Now that my deadline is behind me I had some time to look into it again and I realised there's also a xmlDoc.DataSet.Tables[1] available, which contains the attribute values.
Hi,
I'm using ReadXml() in combination with a XmlDataDocument and have an incoming XML tag like this:
<phonenumber type="1">somephonenumber</phonenumber>
So, I have this:
XmlDataDocument xmlDoc = new XmlDataDocument();
int i = 0;
foreach (DataRow row in doc.DataSet.Tables[0].Rows)
{
...
}...
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.