Search Results

Search found 125 results on 5 pages for 'shantanu'.

Page 5/5 | < Previous Page | 1 2 3 4 5 

  • How to work with CTE. There is some error related to anchor.

    - by Shantanu Gupta
    I am creating a hierarchy representaion of a column. But an error occurs Details are Msg 240, Level 16, State 1, Line 1 Types don't match between the anchor and the recursive part in column "DISPLAY" of recursive query "CTE". I know there is some typecasting error. But I dont know how to remove error. Please just dont only sort out my error. I need explanation why this error is coming. When this error occurs. I am trying to sort table on the basis of sort col that i m introducing. I want to add '-' at every level and want to sort accordingly. Please help WITH CTE (PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, DISPLAY, SORT, DEPTH) AS ( SELECT PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, '-' AS DISPLAY, '--' AS SORT, 0 AS DEPTH FROM dbo.L_CATEGORY_TYPE WHERE FK_CATEGORY_ID IS NULL UNION ALL SELECT T.PK_CATEGORY_ID, T.[DESCRIPTION], T.FK_CATEGORY_ID, CAST(DISPLAY+T.[DESCRIPTION] AS VARCHAR(1000)), '--' AS SORT, C.DEPTH +1 FROM dbo.L_CATEGORY_TYPE T JOIN CTE C ON C.PK_CATEGORY_ID = T.FK_CATEGORY_ID --SELECT T.PK_CATEGORY_ID, C.SORT+T.[DESCRIPTION], T.FK_CATEGORY_ID --, CAST('--' + C.SORT AS VARCHAR(1000)) AS SORT, CAST(DEPTH +1 AS INT) AS DEPTH --FROM dbo.L_CATEGORY_TYPE T JOIN CTE C ON C.FK_CATEGORY_ID = T.PK_CATEGORY_ID ) SELECT PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, DISPLAY, SORT, DEPTH FROM CTE ORDER BY SORT

    Read the article

  • Calling all the 3 functions while using or operator even after returning true as a result.

    - by Shantanu Gupta
    I am calling three functions in my code where i want to validate some of my fields. When I tries to work with the code given below. It checks only for first value until it gets false result. I want some thing like that if fisrt function returns true then it should also call next function and so on. What can be used instead of Or Operator to do this. if (IsFieldEmpty(ref txtFactoryName, true, "Required") || IsFieldEmpty(ref txtShortName, true, "Required") || IsFieldEmpty(ref cboGodown, true, "Required")) { }

    Read the article

  • How to create schema that have an access as that of dbo and can be accessed by sa user

    - by Shantanu Gupta
    I am new to schema, roles and user management part in sql server. Till now I used to work with simple dbo schema but now after reading few articles I am intrested in creating schema for managing my tables in a folder fashion. At present, I want to create a schema where i want to keep my tables that have same kind of functionality. When I tries to create a schema then I faces a problem while using query, permissions etc. First of all i want to get used to of using schemas then only I want to explore it. But due to initial stages and work pressure as well i m not able to implement it yet. What can i do to start using schema with default permissions as that of dbo. Also let me know about creating roles and assigning roles on these schema. I want all this to be accessible by sa user itself at present. What is the concept behind all these things

    Read the article

  • What should I use to increase performance. View/Query/Temporary Table

    - by Shantanu Gupta
    I want to know the performance of using Views, Temp Tables and Direct Queries Usage in a Stored Procedure. I have a table that gets created every time when a trigger gets fired. I know this trigger will be fired very rare and only once at the time of setup. Now I have to use that created table from triggers at many places for fetching data and I confirms it that no one make any changes in that table. i.e ReadOnly Table. I have to use this tables data along with multiple tables to join and fetch result for further queries say select * from triggertable By Using temp table select ... into #tx from triggertable join t2 join t3 and so on select a,b, c from #tx --do something select d,e,f from #tx ---do somethign --and so on --around 6-7 queries in a row in a stored procedure. By Using Views create view viewname ( select ... from triggertable join t2 join t3 and so on ) select a,b, c from viewname --do something select d,e,f from viewname ---do somethign --and so on --around 6-7 queries in a row in a stored procedure. This View can be used in other places as well. So I will be creating at database rather than at sp By Using Direct Query select a,b, c from select ... into #tx from triggertable join t2 join t3 join ... --do something select a,b, c from select ... into #tx from triggertable join t2 join t3 join ... --do something . . --and so on --around 6-7 queries in a row in a stored procedure. Now I can create a view/temporary table/ directly query usage in all upcoming queries. What would be the best to use in this case.

    Read the article

  • When should we use private variables and when should we use properties. Do Backing Fields should be

    - by Shantanu Gupta
    In most of the cases we usually creates a private variable and its corresponding public properties and uses them for performing our functionalities. Everyone has different approach like some people uses properties every where and some uses private variables within a same class as they are private and opens it to be used by external environment by using properties. Suppose I takes a scenario say insertion in a database. I creates some parameters that need to be initialized. I creates 10 private variables and their corresp public properties which are given as private string name; public string Name { get{return name;} set{name=value;} } and so on. In these cases mentioned above, what should be used internal variables or properties. And in those cases like public string Name { get{return name;} set{name=value>5?5:0;} //or any action can be done. this is just an eg. } In such cases what should be done.

    Read the article

  • Can I raise System Error in sql Server in a stored procedure.

    - by Shantanu Gupta
    I am writing a stored procedure where i m using try catch block. Now i have a unique column in a table. When i try to insert duplicate value it throws exception with exception no 2627. I want this to be done like this if (exists(select * from tblABC where col1='value')=true) raiseError(2627)--raise system error that would have thrown if i would have used insert query to insert duplicate value And which method will be better, using insert query or checking for duplicate value before insertion using Select query ?

    Read the article

  • If I take a large datatype. Will it affect performance in sql server

    - by Shantanu Gupta
    If i takes larger datatype where i know i should have taken datatype that was sufficient for possible values that i will insert into a table will affect any performance in sql server in terms of speed or any other way. eg. IsActive (0,1,2,3) not more than 3 in any case. I know i must take tinyint but due to some reasons consider it as compulsion, i am taking every numeric field as bigint and every character field as nVarchar(Max) Please give statistics if possible, to let me try to overcoming that compulsion. I need some solid analysis that can really make someone rethink before taking any datatype.

    Read the article

  • How to Deal with SET ANSI_NULLS ON or OFF ?

    - by Shantanu Gupta
    I want to call this procedure that sends one value that can be NULL or any int value. SELECT DomainName, DomainCode FROM Tags.tblDomain WHERE SubDomainId =@SubDomainId I simply want to use this single query rather than what i m doing right now in below given code. I searched for this how could i do this then i got this Link. According to this I have to set ANSI_NULLS OFF I am not able to set this inside this procedure before executing my sql query and then reset it again after doing this. ALTER PROCEDURE [Tags].[spOnlineTest_SubDomainSelect] @SubDomainId INT AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here IF @SubDomainId IS NULL SELECT DomainName, DomainCode FROM Tags.tblDomain WHERE SubDomainId IS NULL ELSE SELECT DomainName, DomainCode FROM Tags.tblDomain WHERE SubDomainId =@SubDomainId END What will be the better practice to do deal with ANSI_NULLS or Using If Else

    Read the article

  • Where does static variable work in C# page. At Application level or Page Level

    - by Shantanu Gupta
    I had an interview today and every thing was going very good, but then an interviewer asked me a question Where Does Static Variable Work in C#- At Application Level or At Page Level. I was not very much clear about this answer as I only knew that static variables are stored on heap and I didn't knew anything about web related thing about it. Then tried to make me more clear by giving an example that in a page I am using static variable and three users are accessing the page one of the user updates the value of static variable, What value will be visible to remaining two users an old copy or the update will be reflected.

    Read the article

  • Interview Questions that can be asked on TCP/IP, UDP, Socket Programming ?

    - by Shantanu Gupta
    I am going for an interview day after tomorrow where i will be asked vaious questions related to TCP/IP and UDP. As of now i have prepared theoritical knowledge about it. But now I am looking up for gaining some practicle knowledge related to how it works in a network. What all is going in vaious .NET classes. I want to create a very small application like a chat or something that can make me all these concepts very much clear. Could you please suggest some questions related to TCP/IP that you generally ask or that you might have faced. How communication is going from server to client. Right now I am studying TcpClient, TcpListener and UdpClient Class but I want to implement all of them so as to get aware about its working. Is Chat application a Tcp/IP application ? I would appreciate your help.

    Read the article

  • How to work with delegates and event handler for user control.

    - by Shantanu Gupta
    I have created a user control that contains a button. I am using this control on my winform which will be loaded at run time after fetching data from database. Now I need to remove a row from a datatable on the Click event of that button. The problem is that how do I capture that event in my form. Currently it goes in that user control's btn click event defination.

    Read the article

  • how to get result from this data.

    - by Shantanu Gupta
    I want to compute result from this table. I want quantity 1 - quantity2 as another column in the table shown below. this table has more such records I am trying to query but not been able to get result. select * from v order by is_active desc, transaction_id desc PK_GUEST_ITEM_ID FK_GUEST_ID QUANTITY TRANSACTION_ID IS_ACTIVE ---------------- -------------------- ---------------------- -------------------- ----------- 12963 559 82000 795 1 12988 559 79000 794 0 12987 559 76000 793 0 12986 559 73000 792 0 12985 559 70000 791 0 12984 559 67000 790 0 12983 559 64000 789 0 12982 559 61000 788 0 12981 559 58000 787 0 12980 559 55000 786 0 12979 559 52000 785 0 12978 559 49000 784 0 12977 559 46000 783 0 12976 559 43000 782 0 I want another column that will contain the subtraction of two quantities . DESIRED RESULT SHOULD BE SOMETHING LIKE THIS PK_GUEST_ITEM_ID FK_GUEST_ID QUANTITY Result TRANSACTION_ID IS_ACTIVE ---------------- -------------------- ---------------------- -------------------- ----------- 12963 559 82000 3000 795 1 12988 559 79000 3000 794 0 12987 559 76000 3000 793 0 12986 559 73000 3000 792 0 12985 559 70000 3000 791 0 12984 559 67000 3000 790 0 12983 559 64000 3000 789 0 12982 559 61000 3000 788 0 12981 559 58000 3000 787 0 12980 559 55000 3000 786 0 12979 559 52000 3000 785 0 12978 559 49000 3000 784 0 12977 559 46000 3000 783 0 12976 559 43000 NULL 782 0

    Read the article

  • How to use SqlDataSource for filling combobox as well as datatable or Dataset

    - by Shantanu Gupta
    I am trying to fetch a column value from a datasource when some value is selected from a dropdownlist on its change event. <asp:DropDownList ID="ddlCityName" runat="server" DataSourceID="dsCity" DataTextField="CityName" DataValueField="CityID" AutoPostBack="True" OnTextChanged="CityName_OnTextChanged"> </asp:DropDownList> <asp:SqlDataSource ID="dsCity" runat="server" ConnectionString="<%$ ConnectionStrings:GmapConnectionString %>" SelectCommand="SELECT * FROM [vcity]" ></asp:SqlDataSource> Here I want to fetch any other column's value that is not binded to a ddlCityName from sqldatasource. I have four columns in datasource i.e. name, id, address, phno. I want to fetch an address of a person who selects some value from ddl.

    Read the article

  • Why my jquery is not working for a span tag

    - by Shantanu Gupta
    I am trying to display some message in span. but it is not working. <script type="text/javascript"> $(document).ready(function(){ /****************************First Name validation******************************/ $("#txtFirstName").bind("focusout",function(){ if($(this).val()=="" || $(this).val()=="First Name") { $(this).siblings("span[id*='error']").text("First Name Required"); $(this).val("First Name"); } }); $("#txtFirstName").bind("focusin",function(){ if($(this).val()=="First Name") { $(this).siblings("span[id*='error']").show("slow").text(""); $(this).val(""); } }); /********************End First Name validation*****************************/ }); Here is my html code for above code <td><input id="txtFirstName" type="text" value="First Name" runat="server"/><span class="error"></span></td>

    Read the article

  • Working by group by for grouping data into string format

    - by Shantanu Gupta
    I have a table that contains some data given below. It uses a tree like structure i.e. Department SubD1, SubD2 ..... PreSubD1, PreSubD1... PreSubD2, PreSubD2... pk_map_id preferences ImmediateParent Department_Id -------------------- -------------------- -------------------- -------------------- 20 14 5 1 21 15 5 1 22 16 6 1 23 9 4 2 24 4 3 2 25 24 20 2 26 25 20 2 27 23 13 2 I want to group my records on behalf of department then immediate parent then preferences each seperated by ',' i.e. department Immediate Parent preferences 1 5,6 14,15,16 2 4,3,20,13 9,4,24,25,23 and this table also Immediate parent preferences 5 14,15 6 16 4 9 3 4 20 24,25 13 13 In actual scenario all these are my ids which are to be replaced by their string fields. I am using sql server 2k5

    Read the article

  • Working with Jquery. How to change css class of an element in same root

    - by Shantanu Gupta
    I want to change css class of an element on certain event in jquery. eg. focusin: function() { if(this.val()=="First Name") $(this).find("span ").css } $(this).find("span which contains _set").class= mycssclass here I want to change the CSS class of span element whose id contains "_set" as a part of substring in class name and also want to change the text i.e. InnerHtml property of javascript of this span element

    Read the article

  • Is it possible to create an enum whose instance can't be created but can be used for readonly purpos

    - by Shantanu Gupta
    I created an enum where I stored some table names. I want it to be used to get the name of the table like ds.Tables[BGuestInfo.TableName.L_GUEST_TYPE.ToString()]. public class a { public enum TableName : byte { L_GUEST_TYPE = 0 ,L_AGE_GROUP = 1 ,M_COMPANY = 2 ,L_COUNTRY = 3 ,L_EYE_COLOR = 4 ,L_GENDER = 5 ,L_HAIR_COLOR = 6 ,L_STATE_PROVINCE = 7 ,L_STATUS = 8 ,L_TITLE = 9 ,M_TOWER = 10 ,L_CITY = 11 ,L_REGISTER_TYPE = 12 } } class b { a.TableName x; //trying to restrict this ds.Tables[a.TableName.L_GUEST_TYPE] //accessible and can be used like this } This is my enum. Now I have not created any instance of this enum so that no one can use it for other than read only purpose. For this enum to be accessible in outer classes as well I have to make it public which means some outer class can create its object as well. So what can i do so as to restrict its instance creation.

    Read the article

  • Display alert msg in web page when forwarding from one page to another on page load.

    - by Shantanu Gupta
    I have created a html page in php and upon submission i validates that page using PHP. After validating i want to show an alert msg to show its status like showing any greeting or request for re-enter. I have dont validation. Now i m using header( 'Location: http://localhost/assignment/WebForm.htm' ) ; to redirect user to same page but with a alert msg at page load or something like that. What I need to do ?

    Read the article

  • How to get warning massage when clicking close(X) button of browser with tabs in Google Crome

    - by Shantanu
    How to get a warning massage if i accidently click the close button of the chrome browser which have multiple tabs opened at that time? I am a regular user of Crome and having this problem while using it. I normally open multiple tabs inside a single browser but sometimes i accidently click the close button of browser and as soon as the button is clicked crome does't give any warning issue about multiple active tabs and close the entire window. Is the end user like me is browsing on normal crome window then he can open the websites again by checking the web history but if he is browsing inside private browser then he can't do anything(this happens with me very regularly because i normally browse in private browser). On the other hand if you accidently click the close button in mozilla which have multiple tabs open it throws a warning massage to the user and asks for his wish.

    Read the article

  • mail refused by port 25

    - by shantanuo
    When I try to send a mail from my Linux (CentOS) server, the exit status is 0, but the mail never reaches it's destination. The /var/log/maillog file has an entry something like this... Mar 18 06:33:01 app11 postfix/qmgr[22454]: F18FD9F6074: to=<[email protected]>, relay=none, delay=0.01, delays=0/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to alt4.gmail-smtp-in.l.google.com[74.125.45.27]: Connection refused) Am I blocked by google? I tried to send a mail to some other mail server and got the similar result. Mar 18 06:33:01 app1 postfix/smtp[15460]: connect to acsinet11.xxx.com[111.222.333.444]: Connection refused (port 25) How do I correct this problem?

    Read the article

< Previous Page | 1 2 3 4 5