|
|
Problem is that my application is running on dozens of other boxes, so it is not the problem in which i want to change my code. This is some sort of configuration problem which i am not able to resolve.
Regards
Shajeel
|
|
|
|
|
Hi
I am using asp.net 2003(vb code behind). I hve given the connection in web.config like this
<add key="test" value="Provider=SQLOLEDB.1;Password=mypwd;Persist Security Info=True;User ID=myuid;Initial Catalog=Test;Data Source=myserver">
when i changed the data source to another server this is working properly in a lan network
i hve uploaded my project to a site for eg. if i give like www.mysite.com/login.aspx then if i enter the user id and password wht i want is i hve to access the local systems sql database( i want to get data from the database test whose connection i give above). But this is showing error as object reference not set. What should i do now to
Any body pls help me to resolve this problem.do i give any other thing in the connection string
Thanks in advance
with regards
anitha
|
|
|
|
|
micydon wrote: showing error as object reference not set
Set the object reference using New might be a start...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi all,
I am new to SQL user defined function, I wrote an function on my own, I creates this function to get the count of total records available in an speciifed country, it works well, but where is no record in a specified country, it returs NULL and row count as 1. The function which i written is as below
CREATE FUNCTION [dbo].[cnt_country] (@country varchar(12))
RETURNS varchar(5) AS
BEGIN
declare @row_count varchar(5)
select @row_count=[country_code] from [dbo].[countrywise_users]
where [country_code]=@country
return @row_count
END
Actually i need to get the total row's available based on a country. If there is no records for an country , it should return null. Plz any one help me...
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: If there is no records for an country , it should return null.
Did you mean: it should return 0?
In that case you can use:
return IsNull(@row_count, 0)
Wout Louwers
|
|
|
|
|
Hi
thanks a lot. I need this only. Thank you very much
Know is Drop, Unknown is Ocean
|
|
|
|
|
you can use the count function too!
select @row_count = count([country_code]) from.....
Gautham
|
|
|
|
|
SELECT DISTINCT dbo.magdates.mydate, EM.empId AS EId, EM.empName AS EName,
TC.carddate, TC.shift, PM.location, TC.reportingtime AS FromTime,
TC.leavingtime AS ToTime, MHD.AppWHours AS Reg, MHD.AppOtHours AS Ot,
MHD.AppSHours AS SReg, MHD.AppSOtHours AS SOt, SD.Whrs
FROM dbo.tblTimeCardmain TC
INNER JOIN dbo.tblEmployeeMaster EM ON EM.empId = TC.empid
INNER JOIN dbo.tblsalarydetails SD ON SD.EmpID = TC.empid
INNER JOIN dbo.tblProjectMaster PM ON PM.projectID = TC.projectid
INNER JOIN dbo.tblMonthHourDetails MHD ON MHD.EmpId = TC.empid
RIGHT OUTER JOIN dbo.magdates ON TC.carddate = dbo.magdates.mydateWHERE (EM.empId = 213) AND (DATEPART(mm, TC.carddate) = 6) AND
(DATEPART(yyyy, TC.carddate) = 2007) ORDER BY TC.carddate
Hi this is my query...,
See in that magdates table contain dates between 6/1/2007 to 6/30/2007...,
But the tbltimecardmain contain dates between 6/1/2007 to 6/28/2007 only...,
So i used right outer join and selected all the dates from magdates table...,
But its giving only what are the dates contain tbltimecardmain those dates only...,
But i want show the dates 6/29/2007 and 6/30/2007 also...,
How to display magdates all the dates...,
hlp me plz,
Advance Thanks,
Regards,
Magi
|
|
|
|
|
Hello,
Can you please tell me how to pass an array or list to the SQL StoredProcedure.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Get it[^]
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Okay, I don't think this is humanly possible, but I have been asked to run a query on a table based on the insert time of the records. The problem? There is no "Date Created" Column. Is there a way to retrieve the creation time of a row if it is not specifically saved?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Does it have an ID column and do some gues work.
|
|
|
|
|
Hi the follwing procedure i am getting a month all dates...,
In that i am using my own query for the select statement place...,
I used left outer join to show all the dates of @tbl_date...,
But it's displaying only What are the dates i am having in tblMonthhourdetails table those dates only...,
But i want to display all the dates of that month and if the @tbl_date table dates and tbltimecardmain and tblmonthhourdetails dates are matchable those records also want to display...,
Else if there's is no matachable date in that timecardmain table and month hour details table those date place it want to show null...,
I pasted my query on here,
I tried with all joins but i didnt get answer...,
Plz hlp me how to do that...,
Stored procedure:
DECLARE @startDate datetime
declare @nextdate datetime
DECLARE @endDate datetime
declare @tbl_date table (mydate datetime)
set nocount on
SET @startDate = CAST( CAST( 2007 AS varchar(4) ) + '0101' AS datetime )
SET @startDate = DATEADD( m, 6 - 1, @startDate )
set @enddate=dateadd(m,1,@startdate)
while @startdate < @enddate
begin
--SET @nextdate = DATEADD( d, 0, @startdate )
insert into @tbl_date values (@startdate)
set @startdate=dateadd(d,1,@startdate)
end
SELECT EM.empId as EId, EM.empName as EName,ttd.mydate,
TC.shift,PM.location,TC.reportingtime as FromTime, TC.leavingtime as ToTime,
MHD.AppWHours as Reg,MHD.AppOtHours as Ot,MHD.AppSHours as SReg,
MHD.AppSOtHours as SOt,SD.Whrs
FROM dbo.tblEmployeeMaster EM INNER JOIN dbo.tblTimeCardmain TC ON EM.empId = TC.empid
left outer join @tbl_date ttd on ttd.mydate=TC.carddate
left outer JOIN dbo.tblMonthHourDetails MHD ON (ttd.mydate = MHD.SDate
and TC.empid = MHD.EmpId)
--order by EM.empid,ttd.mydate
INNER JOIN dbo.tblProjectMaster PM ON TC.projectid = PM.projectID
INNER JOIN dbo.tblsalarydetails SD ON MHD.EmpId = SD.EmpID
where EM.empid=213 and datepart(mm,Ttd.mydate)=6 and
datepart(yyyy,ttd.mydate)=2007
order by ttd.mydate
Regards,
Magi
|
|
|
|
|
Hi Magi
I think what you want is:
FROM @tbl_date ttd
LEFT OUTER JOIN dbo.tblTimeCardmain TC
ON TC.carddate = ttd.mydate
LEFT OUTER JOIN dbo.tblEmployeeMaster EM
ON EM.empId = TC.empid
LEFT OUTER JOIN dbo.tblsalarydetails SD
ON SD.EmpID = TC.empid
LEFT OUTER JOIN dbo.tblProjectMaster PM
ON PM.projectID = TC.projectid
LEFT OUTER JOIN dbo.tblMonthHourDetails MHD
ON MHD.EmpId = TC.empid
AND MHD.SDate = TC.carddate Your @tbl_date table is the lead-table in the query. The rest of the tables should be outer-joined as they contain the optional data.
Regards
Andy
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
NO andy Still i didnt get answer...,
Now also its displaying what are dates i am having in my tblmonthhourdetails those records only...,
But i need the @tbl_date all dates ,
and if that date and tblcardmain and tblmonthourdetails dates are matchable those records,
other remaining dates place it want to show null...,
Regards,
Magi
|
|
|
|
|
hi all
i'm making database using sql server 2000 and want to connect this database with an application desinged using visual basic6
|
|
|
|
|
I'm sorry, but what's the question? You've stated an intent only. Do you mean how do I do this? If so, I would suggest that you will want to use ADO.
|
|
|
|
|
Well if you want to know what the connection string is, this is the only place for all your connectionstrings : http://www.connectionstrings.com/[^].
Otherwise, please give more information in your question as it is too common.
|
|
|
|
|
hi dere....
i'm not able to create table in sql server 2005 from another table...i know this thing in sql plus in oracle....but i'm not able to construct in sql server 2000
Ashish Vohra
|
|
|
|
|
I am not sure exactly what you mean, could you please clarify your exact requirement?
|
|
|
|
|
SELECT * INTO NewTable FROM OldTable
|
|
|
|
|
SELECT * INTO <newtbl from="" <oldtbl="">
This creates a copy of <oldtbl> to <newtbl>
INSERT INTO <tablea> (<col1>, <col2>) SELECT <col1>, <col2> FROM <tableb>
Inserts rows fetched by select statement into <tablea>
Regards
KP
|
|
|
|
|
How to write script to take backup or restore database(when i run a prticular file it automatically backup or restore database)
|
|
|
|
|
http://www.google.com[^] around for it.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|