Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. kristof

    update statement to populate a table col with random perc values?

    Replace that view above by this, it's shorter: CREATE VIEW vRandNumber AS SELECT ROUND((100 * RAND()) + 1, 0) as RandNumber
  2. kristof

    update statement to populate a table col with random perc values?

    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...
  3. kristof

    Allocate 0 or 1

    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...
  4. kristof

    Allocate 0 or 1

    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
  5. kristof

    Optimize sql with subquery

    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 =...
  6. kristof

    check excel version at install

    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)...
  7. kristof

    Separate executable vs. background thread

    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...
  8. kristof

    Upload keywords and categories from an xml file to sql server

    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.
  9. kristof

    ASPX newbie

    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...
  10. kristof

    Implementing a website search. Where do I look?

    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...
  11. kristof

    IE DropDownList, weird behaviour

    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>
  12. kristof

    IE DropDownList, weird behaviour

    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...
  13. kristof

    Occassional (and unpredictable) 'Could not find stored procedure' erro

    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...
  14. kristof

    GDI+ Bitmaps, potential canvas(es)

    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...
  15. kristof

    Static class vs Session object

    Thanks Jason, that got me going.
  16. kristof

    Static class vs Session object

    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...
  17. kristof

    401: Unauthorized error with a web service

    Nevermind, it was a config error on IIS level. Had nothing to do with the code :-P
  18. kristof

    401: Unauthorized error with a web service

    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...
  19. kristof

    Parsing XML tag with attribute

    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.
  20. kristof

    Parsing XML tag with attribute

    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) { ... }...

Part and Inventory Search

Back
Top