15,991,015 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by anurag19289 (Top 200 by date)
anurag19289
22-Sep-15 7:20am
View
yaa that seems correct, we cant get which format is matched.
And also the UI is not handled from our end :) we are contacting the owner of the service to send only singly format, so that there will be no confusion at our end.
anurag19289
29-Jul-14 5:46am
View
I think this will not work for tables which are being referenced by foreign key
anurag19289
29-Jul-14 5:31am
View
Hi Abhinav,
quick question... How will I know myConstraint when I am looping inside cursor for a particular table ?
anurag19289
22-Jul-14 11:44am
View
thank you very much..it didn't strike me :)
anurag19289
22-Jul-14 11:39am
View
Thanks :)
GROUP BY E.id,E.EmployeeName is missing
anurag19289
12-Mar-14 10:27am
View
ok I tried the below query.
select new BusinessUnit { UnitId = r.UnitId, Name = r.Name }).Distinct().Take(10).OrderBy(c => Convert.ToInt32(c.UnitId)).ThenBy(c => c.Name.StartsWith(StoreIdName)).ToList();
it works for unitid. But if I start with name it doesnot work. As orderby is mentioned first for unitid followed by name.
For example.
unitid name
121 sz
122 sa
122 sc
if I type 12 in my autocomplete textbox. I get correct result
unitid name
121 sz
122 sa
123 sc
but If I type 's' in the textbox
result:
unitid name
121 sz
122 sa
123 sc
--but when I type 's' the result should be
unitid name
122 sa
123 sc
121 sz
--so is it possible to do it?
anurag19289
11-Mar-14 23:52pm
View
user may enter either unitid or name. If UnitId is enterd order by unitId(Not by Name).
If Name is enterd then order by Name(not by UnitId)
--so in the below line i need to do order by UnitId and Name. how to do that.
select new BusinessUnit { UnitId = r.UnitId, Name = r.Name }).Distinct().OrderBy(x=>(Convert.ToInt32(x.UnitId))).Take(10).ToList();
anurag19289
11-Mar-14 23:50pm
View
how to include two columns in one order by. I m stuck here..
List<businessunit> data = (from r in GetStoreHierarchy().Where(p => p.ParentId != "1" && p.ParentId != null).ToList()
where r.UnitId.ToUpper().StartsWith(StoreIdName.ToUpper()) || r.Name.ToUpper().StartsWith(StoreIdName.ToUpper())
select new BusinessUnit { UnitId = r.UnitId, Name = r.Name }).Distinct().OrderBy(x=>(Convert.ToInt32(x.UnitId))).Take(10).ToList();
return data;
--i have done for one column.
anurag19289
23-Feb-14 14:09pm
View
var table = document.getElementById("successFailure");
var row = table.insertRow(2);
var cell1 = row.insertCell();
cell1.innerHTML = "Format and Store Type";
--in this line var cell1 = row.insertCell(); Here it inserts a cell. If i pass parameter as 1 or nothing then it creates a cell with border.
--Meanwhile let me check the links that you provided.
anurag19289
21-Feb-14 21:11pm
View
cool... :)
anurag19289
21-Feb-14 14:10pm
View
in this line itself i am getting error
public class Customer where T : Customer
anurag19289
21-Feb-14 14:08pm
View
so is it the only way to do so ?
anurag19289
21-Feb-14 14:07pm
View
i think as i m using visual studio 2008 probably it doesnot support...
anurag19289
21-Feb-14 14:05pm
View
I am getting error--> constraints are not allowed on non-generic declarations
anurag19289
19-Feb-14 10:58am
View
I will try and get back to you
anurag19289
19-Feb-14 7:38am
View
I am unable to do it. Can you help me giving me an example.
anurag19289
17-Feb-14 23:56pm
View
Let me try and revert you..
anurag19289
17-Feb-14 22:49pm
View
Can you give sample on mvc.
Like in asp.net it is rowdatabound, is there any rowdatabound in webgrid ?
anurag19289
17-Feb-14 8:12am
View
When i a m passing a list to the view, so it should have displayed in the grid.I guess i dont need to loop... Or i am doing somewhere wrong here.
anurag19289
24-Jan-14 23:11pm
View
Thank you...
anurag19289
24-Jan-14 13:26pm
View
Now everything is clear. Simply Superb.
-->So compiler gernerates the parameterless constructor only if there is no other overloaded constructor
--> And you are right :) if we dont specity :base it is equivalent to base(). No default constructor. So error.
Kindly write this in solution I will accept the answer :) Thank you very much.
anurag19289
24-Jan-14 12:24pm
View
Once you start using calls to :base in a derived class, then, in general, you should make sure you have constructors in the base class whose signature match each of the constructors in 'Derivedclass, and, as you found out, you must provide a parameterless constructor in 'BaseClass.
--ok in case 2 of the question. I was missing the parameterless constructor of baseclass. So I got the error.
--------------------------------------------------------------------------------
Ok if I see case:4 of my question. I am not using base keyword. Then why did I get error here.
As per you
"in general, you should make sure you have constructors in the base class whose signature match each of the constructors in 'Derivedclass'"
which is matching
anurag19289
24-Jan-14 11:47am
View
I m not clear with the sentence. Kindly elucidate.
Like can you explain in case 2 of my question where i am getting error.
i have created single parameter constructor in base class. And derived class default constructor is there.
anurag19289
18-Jan-14 8:26am
View
Got it ... Thank you :)
anurag19289
18-Jan-14 7:09am
View
That is really cool. But i have one doubt. As you said i corrected in this way.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace oops1
{
class Program
{
static void Main(string[] args)
{
string strdetail = "Anurag Nayak 8585916787";
string[] details = strdetail.Split(' ');
API p = new API(details);
}
}
}
----------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace oops1
{
public class API
{
string _firstname;
string _lastname;
string _mobilenum;
string[] words;
public API(string [] details)
{
_firstname = details[0];
_lastname = details[1];
_mobilenum = details[2];
}
}
}
--------------------------------
In the Main method now after this line how to retrieve here:
API p = new API(details);
--i i put a breakpoint and reach till the above line(over p) ...i could see the details.
now i want to print in the console all the details.
anurag19289
18-Jan-14 6:45am
View
Actually i knew the above method...but i was exploring something new... like how to make use of object and is it possible to iterate..
Karthik explained a nice way
anurag19289
18-Jan-14 6:40am
View
:) that is superb...
So is the only way to tackle such scenario.
anurag19289
13-Jan-14 22:55pm
View
I was getting only the message view. I dropped the table ..and created the table and function again. Now its working
anurag19289
12-Jan-14 8:40am
View
yaa the method is declared in on in validate1().
My doubt is "why the textbox became empty ?" which is declared in onblur.
anurag19289
11-Jan-14 7:17am
View
This is cool. But can you explain the above scenario.
anurag19289
11-Jan-14 4:04am
View
Thanks thats a good idea to split and check.
anurag19289
11-Jan-14 4:04am
View
Thanks..this works
anurag19289
9-Jan-14 1:33am
View
definitely.. :)
anurag19289
8-Jan-14 10:05am
View
uffffff got the result..
you were absolutely right.
I created a webservice. code in separate file this time.
the code got created in app_code. And asmx outside. But my aspx page was in separate folder Folder1(suppose).
So i copied the asmx and webservice.cs in folder1. exculded the webservice that were created in app_code and asmx that was created outside. Clean build and got the output.
Thank you tadit ji :) :)
anurag19289
8-Jan-14 9:57am
View
i did copy and paste the webservice.asmx(code in the same asmx[didnot create separate file]).
excluded the service which are outside the folder.
clean rebuild
but no result :(
anurag19289
8-Jan-14 9:48am
View
whenever i create a webservice..the webservice.cs is created inside app_code. How to avoid that
anurag19289
7-Jan-14 2:06am
View
and one more doubt like :
in my project this is used but i dont find any service is called.
[AjaxPro.AjaxMethod]
public void fnReleaseLock()
{
TMS.API.Route.VO_Route_Lock Route_Lock = null;
TMS.Business.Masters.INT_Route objBizRoute = null;
try
{
ArrayList iStatus = null;
//release locks
objBizRoute = new TMS.Business.Masters.INT_Route();
Route_Lock = new TMS.API.Route.VO_Route_Lock();
Route_Lock.RouteID = "0";
Route_Lock.Locked = "0";
Route_Lock.LockedBy = Session[TMS.Common.CommonConstants.CONST_USER_ID].ToString();
Route_Lock.LockedTime = DateTime.Now.ToString();
iStatus = objBizRoute.LockRoute(Route_Lock, 1, 10);
//release locks
}
catch (Exception exp)
{
//throw exp;
LogError.WriteError(exp);
}
finally
{
Route_Lock = null;
objBizRoute = null;
}
}
anurag19289
7-Jan-14 1:49am
View
Hello Tadit ji,
What i have understood so far from the links that you gave is
1)we have to add the dll
2)create a webservice
3)Add the specific attribute to the method with [AjaxPro.AjaxMethod].
4)Add the JavaScript function to call the method.
5)Create the call back function to deal with the returned data.
But there are some doubts like
-->when we sould use this(a real time example would be much better)
-->what is the advantage
-->One of the most worthy features of this framework is that it supplies a developer with only one method for call and, therefore, dramatically increases the productivity effect.
(what exactly this line means)
Dear Tadit ji,
kindly read and explain me please.
anurag19289
6-Jan-14 9:18am
View
Hello Tadit ji,
Can i have an explanation in your words regarding this.
anurag19289
4-Jan-14 13:21pm
View
Superb...this works well too :) thank you
anurag19289
23-Dec-13 23:18pm
View
Hats off.. Thank you
anurag19289
23-Dec-13 14:54pm
View
actually the stored procedure is about 440 lines....so i thought it would create much confusion...so i didn't post
anurag19289
23-Dec-13 14:53pm
View
good links
anurag19289
23-Dec-13 1:15am
View
so is it i have to use recursive cte or normal cte can do it? I will take an example and will try and then get back to you.
anurag19289
21-Dec-13 14:03pm
View
I have never used it. Will it solve the problem..can you suggest me a good site so that i can get a clear picture of it...
anurag19289
21-Dec-13 13:56pm
View
nopes....
anurag19289
20-Dec-13 10:21am
View
Brother my email id
anurag.19289@gmail.com
anurag19289
19-Dec-13 7:25am
View
I was doing file-->new website. then its not working
but when i do fiole-->new project. it works. can you clarify this doubt.
anurag19289
19-Dec-13 7:24am
View
i was doing file-->new website. then its not working
but when i do fiole-->new project. it works. can you clarify this doubt.
anurag19289
19-Dec-13 6:24am
View
i am doing in this way.... file-->new website
not file-->new project
anurag19289
19-Dec-13 6:24am
View
no i am was trying to access in this way Gridcustom.DataSource= EmployeeAccessLayer.Employee;
but when i typed EmployeeAccessLayer. I was getting error
anurag19289
17-Dec-13 13:57pm
View
public static class EmployeeAccessLayer
{
public class Employee
{
public int id { get; set; }
public string name { get; set; }
public int age { get; set; }
public string sex { get; set; }
}
anurag19289
17-Dec-13 13:57pm
View
made the class static but not working
anurag19289
14-Dec-13 11:37am
View
i have made it disabled as of now...once i get the correct logic i will make it enable for 150 and ...
kindly help
... and 150 is disabled
//pages.Add(new ListItem("...", "...", false));
//pages.Add(new ListItem(totalpages.ToString(), totalpages.ToString(), false));)
anurag19289
14-Dec-13 11:29am
View
Thats what till this is correct..
i get like
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25...150
a)
... and 150 is disabled
//pages.Add(new ListItem("...", "...", false));
//pages.Add(new ListItem(totalpages.ToString(), totalpages.ToString(), false));)
b)if i don't restrict to 25 pages then the total page becomes 150. and it displays in three line starting from 1 to 150.
c)so i thought like i will display till 25 pages. and when i click on "..."
it should display like below
1...26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50...150
d)and when i click on "..." after 51 then i should get like
1...51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75...150
anurag19289
14-Dec-13 11:21am
View
RyanDev, I have updated the question...
1)ddlhub_SelectedIndexChanged --> on selcection of dropdown the grid will be populated
BindGrid(0, GridZeroApprovedKm.PageSize);
2) this.RepeaterBind(pageindex, GridZeroApprovedKm.PageSize, recordcount);
this gets me the page number....
3)
for (int i = 1; i <= totalpages; i++)
{
if (i <= 25)
{
pages.Add(new ListItem(i.ToString(), i.ToString(), i != (pageindex + 1)));
}
else
{
pages.Add(new ListItem("...", "...", false));
pages.Add(new ListItem(totalpages.ToString(), totalpages.ToString(), false));
break;
}
}
-- i m stuck here...as i am displaying only 25 pages.
anurag19289
14-Dec-13 11:14am
View
you are right... let me update the question
anurag19289
14-Dec-13 3:01am
View
i have updated the code..
anurag19289
14-Dec-13 3:01am
View
Hello Tadit ji. I have updated the code.
Now in RepeaterBind function i am making it as 25 pages. If 150 pages then it was displaying in three rows which looked quite odd. So i restricted it to 25 pages. But how can i handle the things like this..
Question ==> I want to click on ... so that it displays as below
1...26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50...150
And when I click on ... after 50 it should display as
1...51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75...150
anurag19289
10-Dec-13 13:22pm
View
i will try that and get back to you
anurag19289
25-Nov-13 5:23am
View
:)
anurag19289
25-Nov-13 4:54am
View
Ok Vishal...now i am having my holidays.... i will try this once my holidays are over.... And i will let you know....
anurag19289
22-Nov-13 15:48pm
View
means once i search ..if no data is there then it should display as :
No Records found..
but in my case i m getting it as below inside a panel:
-------------------------------------------------------------------
No records found
-------------------------------------------------------------------
Is it possible to avoid that ...or not possible....
anurag19289
22-Nov-13 7:14am
View
ohh sorry i was placing it inside column
getting the result ...but the "No Records found" is coming inside a panel.
How to avoid that
anurag19289
22-Nov-13 7:13am
View
ohh sorry i was placing it inside column
getting the result now...but the "Data Not avaliable" is coming inside a panel.
How to avoid that
anurag19289
22-Nov-13 7:08am
View
Getting this error :
System.Web.UI.WebControls.DataControlFieldCollection must have items of type 'System.Web.UI.WebControls.DataControlField'. 'emptydatatemplate' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.
anurag19289
22-Nov-13 7:08am
View
error :
System.Web.UI.WebControls.DataControlFieldCollection must have items of type 'System.Web.UI.WebControls.DataControlField'. 'emptydatatemplate' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.
anurag19289
21-Nov-13 3:33am
View
correct...
anurag19289
19-Nov-13 8:26am
View
if (@COUNTLMS > @COUNTTAS )
begin
insert #temp2(userid,fromdatelms,todatelms,fromdatetas,todatetas)
select x.userid,x.fromdate,x.todate,y.fromdate,y.todate
from
(
select ROW_NUMBER() over(partition by l.userid order by l.userid) Sr, l.userid, l.fromdate, l.todate from tbl_LMS_Data l WITH(NOLOCK)
where l.FromDate > dateadd(dd,-30,getdate()) and l.FromDate < dateadd(dd,30,getdate())
and l.userid= @userid
) x
left outer join
(
select ROW_NUMBER() over(partition by t.userid order by t.userid) Sr, t.userid, t.fromdate, t.todate from tbl_TAS_Data t WITH(NOLOCK)
where t.FromDate > dateadd(dd,-30,getdate()) and t.FromDate < dateadd(dd,30,getdate())
and t.userid= @userid
) y
on x.Sr = y.Sr
end
else
begin
insert #temp2(userid,fromdatetas,todatetas,fromdatelms,todatelms)
select x.userid,x.fromdate,x.todate,y.fromdate,y.todate
from
(
select ROW_NUMBER() over(partition by t.userid order by t.userid) Sr, t.userid, t.fromdate, t.todate from tbl_TAS_Data t WITH(NOLOCK)
where t.FromDate > dateadd(dd,-30,getdate()) and t.FromDate < dateadd(dd,30,getdate())
and t.userid= @userid
) x
left outer join
(
select ROW_NUMBER() over(partition by l.userid order by l.userid) Sr, l.userid, l.fromdate, l.todate from tbl_LMS_Data l WITH(NOLOCK)
where l.FromDate > dateadd(dd,-30,getdate()) and l.FromDate < dateadd(dd,30,getdate())
and l.userid= @userid
) y
on x.Sr = y.Sr
end
anurag19289
19-Nov-13 7:36am
View
But i have a doubt.... this scenario works...when in table1 we have more data and table2 has less data....... think of a situation where we don know which table has more data...may be table1 or table2 and we want that in single temporary table using the join..what i am doing is as per your suggestion
i am doing as below comment,..
end can you suggest on this ?
anurag19289
14-Nov-13 6:12am
View
Thanks but i dont want this result..
And why i have kept id as same becuase...
there are two tables..
table1 [leaveapplied table]
[it contains more than one record for a userid]
userid leaveappliedfromdate leaveappliedtodate
123 12th nov 18th nov
123 25th dec 28th dec
And in another table the same userid
table2[travel table]
userid Travelfromdate Traveltodate
123 29th nov 1st dec
now i wanted to join these two tables ...last 60days and 60 days ahead....wanted to join in such away so to get the desired result as
userid leaveappliedfromdate leaveappliedtodate travelappliedfromdate travelappliedtodate
123 12th nov 18th nov 29th nov 1st dec
123 25th dec 28th dec null null
anurag19289
14-Nov-13 5:47am
View
--No its not working...
declare @t table(id int, data1 int, data2 int)
declare @b table(id int, value1 int, value2 int)
insert into @t(id, data1, data2)
values(1, 100, 150)
insert into @t(id, data1, data2)
values(1, 200, 250)
insert into @t(id, data1, data2)
values(1, 300, 350)
insert into @b(id, value1, value2)
values(1, 1000, 1050)
select t1.id,t1.data1,t1.data2,t2.value1,t2.value2 from @b t2
right join
@t t1 on t1.id = 1;
anurag19289
14-Nov-13 5:37am
View
That is cool :) Thanks
anurag19289
14-Nov-13 5:33am
View
i have just taken an example as id..
anurag19289
14-Nov-13 5:28am
View
Let me try and get back to you
anurag19289
13-Nov-13 7:02am
View
That is nice :)
anurag19289
13-Nov-13 7:01am
View
Super...
anurag19289
13-Nov-13 6:13am
View
:)
anurag19289
12-Nov-13 8:27am
View
Kindly rate my answer and accept it if it helped you :)
anurag19289
11-Nov-13 11:42am
View
Thanks you :)
anurag19289
11-Nov-13 10:03am
View
Thanks for your response Tadit ji :) I have one doubt.
'select * from tbl_employee where first_name like'+ '''%tadit%'''
so in this case if we see
like'-->this is the end of first quote(unlike the above case)
And here first quote is start of second string. And the next two is behaving like single quote
'''%tadit%'''
And then next two quotes behaving as single quote. And the last one is close of second string.
Am i right ?
anurag19289
9-Nov-13 15:15pm
View
nice..thank you
anurag19289
8-Nov-13 12:09pm
View
:)
anurag19289
8-Nov-13 12:08pm
View
good1
anurag19289
8-Nov-13 10:25am
View
unable to understand..improve your question
anurag19289
8-Nov-13 7:58am
View
Deleted
:(
anurag19289
8-Nov-13 7:51am
View
Deleted
ok brother sorry.
anurag19289
8-Nov-13 7:46am
View
Deleted
Ok thanks.. will take care of it next time... kindly remove that comment "we do not do your home work" and "It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. "
anurag19289
7-Nov-13 11:21am
View
i tried this :
create table checksumcheck
(
value int
)
insert into checksumcheck
select 13
union all select 23
union all select 45
union all select 55
union all select 66
SELECT CHECKSUM_AGG(CAST(value AS int))
FROM checksumcheck
--i got o/p =66
--now how this 66 is the output.
--is it random
--when i update any one column .the o/p changes.
--Where this checksum_agg can be useful ? In what scenario ?
anurag19289
7-Nov-13 10:44am
View
that is not clear...give me your own example
anurag19289
7-Nov-13 2:41am
View
ok ok ....its divide acually
anurag19289
6-Nov-13 8:15am
View
But when i am trying the dot in numlock section[numbers in right side of the keyboard]. Getting the error. But it works fine for the key near comma(,).
anurag19289
28-Oct-13 7:12am
View
good1
anurag19289
28-Oct-13 7:04am
View
Hi Nijboer- I faced a situation like....when i was opening a child window from a parent window...and doing somechanges in child window.....and then closing the child window.....and when again open child window.....i was unable to find the changes done on child window...
I tried this..<%@ OutputCache Location="None" VaryByParam="none" %> . Then it worked..
So what i understood from the link you gave is that ..
if location=None - This turns off the output cache. So it will not pick from the memory/client browser....when i make later requests...
Is my understanding correct ?
anurag19289
25-Oct-13 10:13am
View
<%@ OutputCache Location="None" VaryByParam="none" %> .
This when i put in child window...now its working
anurag19289
25-Oct-13 10:12am
View
Hi Sergey-
I asked my lead regarding this doubt.
He told me to put this code
<%@ OutputCache Location="None" VaryByParam="none" %> .
And it worked. But i m not clear exactly why we need this. It would be a greate help if you explain me this.
anurag19289
25-Oct-13 8:53am
View
Parent page is refreshing but....if i click on parent page link button and check in child window the new item which i recently added..i dont find....
i log out and log in again and navigate to that page and click on linkbutton. I find the record is inserted....
what can be the issue...even if i hit search button and populate the grid and click on the link button ...i find the new data is not inserted......but if i close the application and login and navigate to the page and click on link button ..then i find that record
anurag19289
25-Oct-13 7:57am
View
Hi bikram-
The in your child page just call opener.reloadParent(); in javascript after you finish your operation in child page.
where to write this exactly..
In the rowcommand event of gridview : the data is inserted
if (identityCreated > 0) {
ScriptManager.RegisterStartupScript(Page, typeof(Page), "", "alert('" + System.Configuration.ConfigurationSettings.AppSettings["Save_Record"].ToString() + "');", true);
BindShuttleDetails();
UpdatePanel1.Update();
}
Then shall i write after updatepanel1.update();? Kindly help
anurag19289
25-Oct-13 7:53am
View
question updated : in parent page
lbtn.Attributes.Add("onClick", "var sFeatures='dialogHeight: 700px;dialogWidth: 1000px;'; window.showModalDialog('Shuttle_StopDetails.aspx?shuttlefacilityid=" + lblshuttlefacilityid.Text + "&facility=" + lblfacilityid.Text + "&Trip=" + lbltrip.Text + "','',sFeatures);window.document.forms[0].submit();");
then in child page on rowcommand adding a new item in the footer of grid view....and then closing the child window....and then clicking the linkbutton of parent window to check whether updated or not....
anurag19289
25-Oct-13 7:45am
View
Let me try this and get back to you...
anurag19289
24-Oct-13 12:28pm
View
Got it :)
anurag19289
24-Oct-13 12:28pm
View
Thanks :)
anurag19289
24-Oct-13 12:28pm
View
Thank you :)
anurag19289
24-Oct-13 6:35am
View
Ok thanks for the help VICK...
i will do more analysis on this..
anurag19289
24-Oct-13 6:12am
View
Hi Vick-So what i have understood
1)when we are editing ,updating or cancelling in gridview...obviously we are binding the grid again...
So in this case we cant make the enable view state propery to be false
doubt : what happens if we make it false ?
2)if a grid is binding normally. we are not editing/updating/cancelling. In this case it would be wise to make it false
I have read in the article you have provided. It suggests that where ever its not required we should disable it.
So if in the second case is it like if its enabled ...then the hidden field value in view source increases....leading to performance issue
kindly correct me if i am wrong
anurag19289
15-Oct-13 7:51am
View
Hi Zafar-
I will try this and revert you.
anurag19289
15-Oct-13 6:58am
View
This seems interesting. I will try and get back to you
anurag19289
14-Oct-13 10:14am
View
That is very nice explanation. Thank you :)
anurag19289
14-Oct-13 5:03am
View
ok :)
anurag19289
14-Oct-13 4:03am
View
Hi Tanweer-
What i understood is : Suppose you have a gridview as below. And on searchbutton the grid populates as below.
column1 is routecolumn2 is number of routes.
column3 is linkbutton which opens the popup.
column1 column2 column3
route1 4 linkbutton
route2 5 linkbutton
Now you click the linkbutton of route1 and add one record. And when you close the popup. The count which was 4 for route1 is not increased to 5. So you peroform _dopostback before you close the window and pass searchbutton as event target value to the postback function and the grid populates again and the records are displayed correctly.
Kindly correct me if i am wrong.
anurag19289
12-Oct-13 12:13pm
View
link error
anurag19289
4-Oct-13 13:23pm
View
ok i replaced or by and.
SearchEmployee '','','',''
now the above execution give me all the result.
but when i try
SearchEmployee 'anurag','','',''
i get
select * from employee where Name=anurag
Msg 207, Level 16, State 1, Line 1
Invalid column name 'anurag'.
anurag19289
2-Oct-13 12:13pm
View
:( oops
anurag19289
2-Oct-13 10:42am
View
so which edition i need to install ?
anurag19289
2-Oct-13 10:08am
View
And then i tried to refresh the sql server log but i did not get that...
If i right click on sql server logs and click on view i get to see Database Mail(unchecked).But if i check and close but still the database mail node is not seen in sql server logs.
anurag19289
2-Oct-13 10:07am
View
I tried this...
Exec sp_configure 'show advanced options',1
go
Reconfigure with override
go
Exec sp_configure 'Database Mail XPs',1
go
Reconfigure with override
go
anurag19289
2-Oct-13 9:38am
View
Hi rohan-
in the textbox user can enter numbers as well as decimal. but the ascii of decimal was not working. But i got to know that the ascii of '.' is 190 but not 46
anurag19289
1-Oct-13 10:12am
View
This is superb..... +5
NOw this is what i was looking for. Its working perfectly fine now.
anurag19289
1-Oct-13 4:53am
View
Hi Gyan-
I have mentioned as not equal to.(!)
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)))
anurag19289
25-Sep-13 16:20pm
View
ok coool :)
anurag19289
25-Sep-13 14:00pm
View
And then i tried searching ..how we can exactly use distinct and then put rownumber to it...i got this cte as a way...
with cte as(select distinct(t1.address_id),t1.hub_id from #temp2 t2
join #temp1 t1 on t2.address_id=t1.address_id
where t1.hub_id=20),
cte1 as
(select address_id, row_number() over (order by address_id) as row from cte)
select * from cte1
--now in this row is a header i am using in cte(select address_id, row_number() over (order by address_id) as row from cte)
anurag19289
25-Sep-13 13:56pm
View
Hi Sergey-
in this query its a part of #temp3
insert into #temp3(address_id,hub_id,row)
select distinct(t1.address_id),t1.hub_id, ROW_NUMBER() over (order by t1.address_id) as rownumber from #temp2 t2
join #temp1 t1 on t2.address_id=t1.address_id
where t1.hub_id=20
--i have created the #temp3 first(which i have not shown)
anurag19289
24-Sep-13 16:29pm
View
i have updated in the comment:
address_id facility_id
123 20
123 20
123 20
in tbl_geocode_address (tg)
address_id
123
anurag19289
24-Sep-13 16:24pm
View
name and address columns just i gave for example(like there are many columns in the table)...i have updated now..
anurag19289
24-Sep-13 16:15pm
View
Actually Maciej
In my actual query i got stuck in one join.......like the actual query in my project is like
insert into #approve(rownumber,address_id,hub_id,hub_name,geocode_address,distanceByOps,distanceByCtv)
(select ROW_NUMBER() over(order by tg.address_id) as Rownumber,distinct(tg.address_id) as address_id,hub_id,
@hub,distinct(isnull( Landmark,'') +' '+ isnull(Colony,'') +' ' +isnull(Sub_Colony,'')+' '+isnull(CITY,'')) as geocode_address,
distancebyops,distancebyctv
FROM
tbl_Geocode_Address tg with(nolock)
join tbl_user_master tum with(nolock) on tum.address_id=tg.address_id and tum.Facility_ID=@HUB_ID
left join APPROVED_KM_OPSCTV tak on tak.address_id=tg.Address_ID and tak.hub_id=@HUB_ID
WHERE
tg.ADDRESS_ID NOT IN(SELECT TO_ID FROM tbl_approved_distances with(nolock) WHERE FROMID=@HUB_ID) and mmim_key is not null
and tg.Hub_Ids like '%' + cast(@HUB_ID as varchar) +'%'
or tg.ADDRESS_ID IN(SELECT TO_ID FROM tbl_approved_distances with(nolock) WHERE FROMID=@HUB_ID and Distance=0))
--now
join tbl_user_master tum with(nolock) on tum.address_id=tg.address_id and tum.Facility_ID=@HUB_ID
in tbl_user_master (tum)
address_id facility_id
123 20
123 20
123 20
in tbl_geocode_address (tg)
address_id
123
i was joining these two tables....tum.address_id=tg.address_id and tum.Facility_ID=@HUB_ID (@hub_id=20)
--but i was getting 3 duplicate records...i wanted to avoid that...as rownum is also there.,,,it was tough for me ..like how to use distinct
anurag19289
24-Sep-13 14:39pm
View
i will try that and get back to you
anurag19289
22-Sep-13 9:59am
View
I tried this too :
<script type="text/javascript">
$(function(){
$('[id*=chkbcopy]').click(function(){
var chkHeader = $(this);
if (chkHeader.is(":checked"))
{
$("[id*='GridZeroApprovedKm'] tr").each(function () {
$("[id*='txtdistancectv']").val($("[id*='txtdistanceops']").val());
});
}
else
{
$("[id*='txtdistancectv']").val('');
}
});
});
--but the same result
anurag19289
22-Sep-13 9:53am
View
Kindly help me ...
anurag19289
22-Sep-13 9:53am
View
I tried this:
<script type="text/javascript">
$(function(){
$('[id*=chkbcopy]').click(function(){
var chkHeader = $(this);
if (chkHeader.is(":checked"))
{
$("[id*='txtdistancectv']").val($("[id*='txtdistanceops']").val());
}
else
{
$("[id*='txtdistancectv']").val('');
}
});
});
</script>
--but its copying the first row of gridview to all the text box.
--means if if in column1 the values are 3 4 5 6
--coulumn two values are fetched ike 3 3 3 3
--aspx page
<asp:TemplateField HeaderText="Approved Km By CTV" Visible="false">
<HeaderTemplate>
<asp:CheckBox ID="chkbcopy" runat="server" Text="Approved Km By CTV"/>
</HeaderTemplate>
<itemtemplate>
<asp:TextBox ID="txtdistancectv" MaxLength="6" class="test" CssClass="textBox_for6tds" runat="server">
<itemstyle horizontalalign="center">
anurag19289
22-Sep-13 8:50am
View
I tried like this : Added class to both the textbox (test)
<asp:TemplateField HeaderText="Approved Km By Ops">
<itemtemplate>
<asp:TextBox ID="txtdistanceops" MaxLength="6" class="test" CssClass="textBox_for6tds" runat="server"
Text='<%#Bind("distanceByOps") %>'>
<itemstyle horizontalalign="center">
<asp:TemplateField HeaderText="Approved Km By CTV" Visible="false">
<itemtemplate>
<asp:TextBox ID="txtdistancectv" MaxLength="6" class="test" CssClass="textBox_for6tds" runat="server">
<itemstyle horizontalalign="center">
---then i tried in this way....not working
<script type="text/javascript">
$(function() {
$('.test').keydown(function(e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)))
{
e.preventDefault();
alert("Please enter numeric value!");
$('[id*=txtdistanceops]').val('');
}
}
});
});
anurag19289
22-Sep-13 8:49am
View
Deleted
I tried like this : Added class to both the textbox.
<asp:TemplateField HeaderText="Approved Km By Ops">
<itemtemplate>
<asp:TextBox ID="txtdistanceops" MaxLength="6" class="test" CssClass="textBox_for6tds" runat="server"
Text='<%#Bind("distanceByOps") %>'>
--then i tried this
<script type="text/javascript">
$(function() {
$('.test').keydown(function(e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)))
{
e.preventDefault();
alert("Please enter numeric value!");
$('[id*=txtdistanceops]').val('');
}
}
});
});
</script>
--but not working
<itemstyle horizontalalign="center">
<asp:TemplateField HeaderText="Approved Km By CTV" Visible="false">
<itemtemplate>
<asp:TextBox ID="txtdistancectv" MaxLength="6" class="test" CssClass="textBox_for6tds" runat="server">
<itemstyle horizontalalign="center">
anurag19289
19-Sep-13 23:36pm
View
Thank you very much :) :)
i understood.....
you are awesome....
anurag19289
18-Sep-13 10:02am
View
Thank you ... so the colum index starts from 0.
It's working :)
anurag19289
18-Sep-13 8:53am
View
<script type="text/javascript">
$(function() {
$('[id*=txtdistanceops]').keydown(function(e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)))
{
e.preventDefault();
alert("Please enter numeric value!");
$('[id*=txtdistanceops]').val('');
}
}
});
});
</script>
---now this is working
--now when gridview is having textbox i think we have to use $('[id*=txtdistanceops]').keydown(function(e) insetead of $('#txtdistanceops').keydown(function(e)
is it so ?
anurag19289
18-Sep-13 8:36am
View
i m trying this in home..its working
but when i tried this in office as below its not working:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ApprovingKm.aspx.cs" Inherits="TMSWeb.Masters_Route_ApprovedKm" %>
<%@ Register Src="../../UserControls/ContextMenu.ascx" TagName="ContextMenu" TagPrefix="uc3" %>
<%@ Register Src="../../UserControls/CustomDataView.ascx" TagName="CustomDataView"
TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%HeaderHTML("Approving Km", 2, 0);%>
<body>
<link href="../../Utility/Style/TMS.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Utility/JavaScript/wz_tooltip.js"></script>
<script type="text/javascript" language="javascript"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
.selected
{
background-color: #A1DCF2;
}
</style>
<script type="text/javascript">
$(function() {
$('#txtdistanceops').keydown(function(e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)))
{
e.preventDefault();
alert("Please enter numeric value!");
$('#txtdistanceops').val('');
}
}
});
});
</script>
anurag19289
17-Sep-13 14:13pm
View
And one more doubt
is src="http://code.jquery.com/jquery-1.8.2.js"
is this src standard ? is it going to work everywhere ?
anurag19289
17-Sep-13 14:10pm
View
one way is found --> reset the textbox after the alert message
<head runat="server">
<title></title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
$('#TextBox1').keydown(function(e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)))
{
e.preventDefault();
alert("Please enter numeric value!");
$('#TextBox1').val('');
}
}
});
});
</script>
-->please let me know how we can display a message box error when any non numeric key is entered
anurag19289
17-Sep-13 14:07pm
View
<head runat="server">
<title></title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
$('#TextBox1').keydown(function(e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)))
{
e.preventDefault();
alert("Please enter numeric value!");
}
}
});
});
</script>
-- i was trying to have an alert [message box] type error.
--but this is giving alert message but the character[like a] is entered in textbox
anurag19289
17-Sep-13 13:58pm
View
i m using <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
and its visual studio 2008
anurag19289
17-Sep-13 13:46pm
View
Deleted
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
i m using this...its vs 2008
anurag19289
15-Sep-13 10:24am
View
Sampath-
when i write event then followed by .(dot)
i m not getting[preventDefault] event.preventDefault.
Am i missing anything.
its not working.
anurag19289
15-Sep-13 6:09am
View
Thanks for the help :)
anurag19289
15-Sep-13 6:07am
View
its working but i would like to know
var grid = $(this).closest("table");
anurag19289
15-Sep-13 6:05am
View
Deleted
sorry its working... :)
but i would like to know about this...
var grid = $(this).closest("table");
anurag19289
15-Sep-13 5:54am
View
Deleted
Kindly give other solution...i tried this too...its not working
anurag19289
15-Sep-13 5:49am
View
what does this mean ?
var grid = $(this).closest("table");
anurag19289
15-Sep-13 5:17am
View
Deleted
Its not working....
anurag19289
13-Sep-13 17:17pm
View
cool its working... :)
anurag19289
13-Sep-13 15:13pm
View
kindly post that too
anurag19289
13-Sep-13 15:13pm
View
ok bro..
anurag19289
13-Sep-13 11:30am
View
Ok Ok...Is there any other way to write this query ?
anurag19289
13-Sep-13 11:18am
View
ok but union is going to give me duplicate values i guess..
and i need a query other than union or union all...
anurag19289
13-Sep-13 11:01am
View
This is working brilliantly :)
anurag19289
13-Sep-13 9:47am
View
Thanks bro :)
anurag19289
12-Sep-13 8:27am
View
yes i am using update panel
anurag19289
12-Sep-13 5:39am
View
Hello KR-
It's working....But it seems its taking much time as compared to what javascript does....allow paging i have made to true in gridview. And 10 records are displayed per page.
and in code behind i have shortened the code as :
protected void sellectAll(object sender, EventArgs e)
{
foreach (GridViewRow row in GridZeroApprovedKm.Rows)
{
((CheckBox)row.FindControl("chkb2")).Checked = ((CheckBox)sender).Checked;
}
}
--so using the update panel and content template....why its taking much time ?
anurag19289
12-Sep-13 5:31am
View
let me try and get back to you...
anurag19289
12-Sep-13 5:29am
View
This will work...But is it possible to do without using javascript.
anurag19289
12-Sep-13 5:25am
View
Hi this is the same thing you have written what i have written above... but the page is refreshing.
i want to do this without using javascript...kindly help
anurag19289
11-Sep-13 23:28pm
View
so if i want to do it through server side...then this autopostback property has to be true ? is it correct ?
anurag19289
6-Sep-13 11:34am
View
Thats why i always i say you "you are simply awsome". A perfect explanation. This is what i was looking for :) cheers +5
anurag19289
5-Sep-13 13:02pm
View
So you mean to say that the best way to solve the problem is to create a permanent table ...and insert into that permanent table as per if condition...And finally that permanent table will be inserted in temporary table....And i can work with that temporary table in the cursor....Is there any other way ?
anurag19289
5-Sep-13 8:08am
View
Thanks :) it worked
anurag19289
5-Sep-13 8:08am
View
Awsome Mike...It worked...:)
anurag19289
4-Sep-13 14:59pm
View
Let me try that tomorrow and get back to you
anurag19289
4-Sep-13 14:58pm
View
ok mubin let me try that in office tomorrow...and i will get back to you
anurag19289
4-Sep-13 13:44pm
View
Mike -
set @NEW_ROUTEID = @@identity
PRINT '@NEW_ROUTEID:' + CAST(@NEW_ROUTEID AS VARCHAR(50))
INSERT INTO TBL_ROUTE_STOP_DETAIL (Route_ID,Stop_Number,Address_ID)VALUES(@NEW_ROUTEID,1,@FROM_ADDRESS)
This statement is correct right. A identity i m storing in @NEW_ROUTEID and that i am using immediately after in the insert statement. Is this correct ?
anurag19289
4-Sep-13 13:42pm
View
Hello Mike- When i execute this no exception is raised..
I have never used interactive debugger.. i m using print statement to debug..how to use this interactive debugger
i get in message as :
TYPE:P
fromdate:Sep 7 2013 12:00AM
todate:Sep 7 2013 12:00AM
@USERID-->51333357
@APPDATE-->Sep 7 2013 6:30AM
@FROM_ADDRESS-->206950
@TO_ADDRESS-->65597
@TO_FACILITY_ID-->639
@NEW_ROUTEID:880315
--finally after the completion of my cursor there is a select statement..
--but i m not getting any result
anurag19289
28-Aug-13 9:55am
View
Let me try and get back to you
anurag19289
27-Aug-13 4:37am
View
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
anurag19289
27-Aug-13 4:36am
View
The OLE DB provider "MICROSOFT.JET.OLEDB.12.0" has not been registered.
anurag19289
27-Aug-13 1:16am
View
let me try and get back to you
anurag19289
27-Aug-13 1:12am
View
i think it is possible to do in sql server 2005. In later version it doesnot allow.
anurag19289
26-Aug-13 14:02pm
View
ok....
anurag19289
26-Aug-13 13:14pm
View
In one of my table i have around 20 columns. The 18th number column is most needed for me. Everytime i have to write in this way.
select status,* from tbl_route_detail where route_id=23324 and userid='24524524'
so i thought if i can change the ordinal position...then directly i can see that column
anurag19289
26-Aug-13 11:56am
View
It's simple Bro... I want to copy data from excel sheet to sql table. In excel sheet i have the same header column as per the table. Then i am executing the above commands. Hope its cleared.
But the above command is not working.
anurag19289
26-Aug-13 11:53am
View
Microsoft Office Excel 2010
anurag19289
26-Aug-13 9:03am
View
Brother i am little confused... i have updated the question
anurag19289
21-Aug-13 11:21am
View
just now i saw your answer... i have posted the below answer..and then i saw your answer...
Thanks Tadit.. Yes i am accepting your answer... and i am deleting the below answer...
anurag19289
20-Aug-13 10:07am
View
You are really genius :) Both are working perfectly fine... :) :) i liked the first approach
anurag19289
20-Aug-13 9:44am
View
Hi Rohan-
The two querries were not identical. I think i should have elaborated it more clearly.
select * from #tempmonthly with(nolock) order by hub_id desc
Rohan- i have the hub id as
12
20
136
9
1
652
and so on.
but if i do order by hub_id desc
i will get output like
652
136
20
12
9
1
in this way...
but actually i wanted in this way : 12 ,20,136,9,1,652
so i searched google for this. from one article i got a solution like
order by decode( sorted, 'F',1, 'C',2, 'A',3, 'B',4, 'G',5, 'D',6, 'E',7, 8 )--he was trying to order the letters as per his wish
--so i thought i can use this
select * from #tempmonthly with(nolock) order by hub_id (sorted,12,1,20,2,136,3,9,4,1,5,652,6)
but i was unable to do....
anurag19289
20-Aug-13 8:31am
View
question is improved...
anurag19289
20-Aug-13 8:28am
View
i tried to google it ,,, i got that sorted part...so immediatey after order by (sorted,)
this starts... but this is not working
anurag19289
20-Aug-13 8:26am
View
thanks for your comment.. let me clear it..
query 1
select * from #tempmonthly with(nolock) order by hub_id (sorted,12,1,20,2,136,3,9,4,1,5,652,6,672,7,129,8,240,9,17,10,14,11,627,12,18,13,574,14,158,15,145,16)
query 2
select * from #tempmonthly with(nolock) order by hub_id
anurag19289
20-Aug-13 3:59am
View
I got the solution..we have to use sum and average like this as below
anurag19289
20-Aug-13 3:40am
View
Hi Manas-
the above query will not fetch me the exact result.
like the above query the output will be :
SalesPersonId Numbers Average
1 24 24
2 72 36
3 72 36
4 72 72
5 24 24
6 18 18
but the average i am looking for is the average of second column:
24
72
72
72
24
18
that is 47. so i need to write that query in such a way that i will get 47 as output. Now this can be done using CTE. But i wanted to write a query without cte. Please try and let me know.
anurag19289
9-Aug-13 10:26am
View
Deleted
Ok Manas.. I understood it ..But a quick question is ,,,when to use it..
So i was trying like this :
create table #temp2
(
salespersonid int,
orders int
)
insert into #temp2(salespersonid,orders)
select 1,24
union all select 2,24
union all select 3,48
union all select 4,72
union all select 5,24
union all select 6,18
union all select 2,48
union all select 3,24
select * from #temp2
select AVG(SELECT sum(orders) from #temp2 group by salespersonid)
but i m unable to do it.
So is it because of this that we are using this with clause ?
WITH MY_CTE (num)
AS
(
SELECT sum(orders) as numbers from #temp2
group by salespersonid
)
SELECT AVG(num) AS "Average Sales Per Person"
FROM MY_CTE;
GO
anurag19289
8-Aug-13 15:19pm
View
As both the triggers are there which inserts one in test1 and the other in test2. How it selects 7. that is trigger parentins[trigger] is preferred over parentinns[trigger]. This is the doubt..
anurag19289
8-Aug-13 15:17pm
View
doubt regarding @@IDENTITY
scenario:
create table test1
(
id int identity(1,1),
name varchar(50)
)
create table test2
(
id int identity(1,1),
name varchar(50)
)
CREATE TRIGGER Parentinss ON test1 FOR INSERT
AS
BEGIN
insert into test1 values('usa')
END;
CREATE TRIGGER Parentins ON test1 FOR INSERT
AS
BEGIN
insert into test2 values('india')
END;
insert into test1 values('ANURAG')
insert into test1 values('abhishek')
insert into test2 values('japan')
insert into test1 values('china')
select * from test1
select * from test2
select SCOPE_IDENTITY()
select @@IDENTITY
--There are two triggers. Now both triggers is on test1. one trigger inserts into test1 and the other on test2.
--select SCOPE_IDENTITY()
select @@IDENTITY
@@identity gives me the output as 7 . why ?
why doesnt it give me 6.
anurag19289
8-Aug-13 9:34am
View
ooops oops oops... i got it .... thanks
anurag19289
8-Aug-13 4:48am
View
Thanks.. its working now :)
anurag19289
8-Aug-13 4:48am
View
Superb,,,,:) thanks :)
anurag19289
5-Aug-13 13:03pm
View
ok.. thanks..
anurag19289
5-Aug-13 11:39am
View
So you mean to say like :
if string s is null
and s.trim will give nullreference exception...
so i can avoid it by writing like this
if (string.IsNullOrEmpty(s))
{
s= string.empty;
}
else
{
s= s.trim();
}
anurag19289
5-Aug-13 11:34am
View
but can textbox.text return null ever ?
I thing if the text box is empty then it will always be--> "" [which is nothing but string.empty]
So is the code below is useful ? correct me if i am wrong...
string.IsNullOrEmpty(txt_Token_ID.Text) ? string.Empty : txt_Token_ID.Text;
anurag19289
2-Aug-13 9:40am
View
yes Maciej is correct....
anurag19289
2-Aug-13 9:39am
View
ok ok okkkkkk.... got it,,,,, :) thanksssss
anurag19289
2-Aug-13 9:38am
View
i want to do it in backend
anurag19289
2-Aug-13 9:22am
View
Adarsh Maciej has given a good answer. But that will not work if i want the number whose occurencce is more will come first[like 800].
Requiremnt is something ike: i have two drop down.like example in dropdown1
1)facility12)facility23)facility3under facility1 we have so many claim amount
1)8002)8003)8004)8005)4006)4007)6)400 6008)600
similarly for facility2 some values and for facility3 some values...
so as soon as i select facililty1 in dropdown1 in dropdown2 it will be like800 400
600
And then search button is there ... as per the list populated in dropdown2... we select.. and manipulate the things,,,, i hope you got it what i am looking for,.,, for this dropdown2 ..i am working ,,, so i want some simle query in back end which will do my purpose
Like in dropdown2 the number which comes in top...its and indication to the user that under facility1 ,,,,the maximum number of employees are claiming 800 rs
then 400 rs
then 600 rs
anurag19289
2-Aug-13 9:10am
View
its an answer
Show More