|
Hi,Thanks
your code supported me very well and now it is successfully working.once again thanks
But i have one more question i have written a query which is of around 11 lines which extracts the record of the employees working for bank they are around more than 10000 employees,for this i have been using stored procedure.so please suggest me how to extract employee information with optimised time.please suggest me how to execute the long querys with out using stored procedures or ...................
|
|
|
|
|
Hi ..
how to find a record on a dataset ...
vb.net 2005
jooooo
|
|
|
|
|
int idx=0;
//this assumes that a DataSet already exists called ds
DataView dv = ds.Tables[idx].defaultView;
//this assumes that the column your are searching is the one
//specfied by the DataView.Sort see msdn2.microsoft.com/en-us/system.data.dataview.sort.aspx
int foundIdx = dv.find(yourSearchTerm);
sacha barber
|
|
|
|
|
i want code to let the user specify their ID and password anf verfiy passwords to enter the application
|
|
|
|
|
Mr.Kode wrote: i want code to let the user specify their ID and password anf verfiy passwords to enter the application
I'm not exactly sure what you are asking.
Are you asking for help with the data model such that you can store this information in the database?
Do you have a data model, but are unsure of how to query it?
Do you need help calling the query from your application?
Can you provide more information, please. It will help us answer your query accurately.
|
|
|
|
|
my application consist of multiple forms and i want to make the first form as log in form , all i want is to let the users assign their log in names and passwords and save these log in details on the log in table , as any application does ..
many thanks
|
|
|
|
|
give me triggers advantages...
|
|
|
|
|
you can use them to stop unwanted inserts, or deletes, updates
you can use INSERTED, DELETED tables in triggers in SQL server to see new data
They are nice to preserve referentially integrity.
Other than that I cant think of a really cool use of triggers.
I guess one could also use them for additional security if some bad user got a valid connection string and attempted to hack you Dbase.
You could use a trigger say to test for logged in, and only then permit the users action
sacha barber
|
|
|
|
|
hi every one,
well a few days ago I posted a questio abt the problem in transactional replication . well now I've been able to setup the replication among the Databases (SQL Sevrer 2000) but still there are a few problems remaining to be solved:
1. while I was making the pull subscription there were a lot of errors on many tables like "cannot copy bulk to tablexyz", "Alter table statement failed due to foreign key constraint", "Cannot drop table.." etc but now there is only one error left on a products table that has a self join. it says some thin like "Alter statement failed due to foreign key same name contstraint " or somethin liek that. and I tried all the options in the snapshot tab of the article but every time there is some error like bulk copy error or this or somethin else. So right now I am absolutely void of any further ideas and God it really is frustrating. Can u plzz give me some clue of whats goin on. What should I do here. is there any alternative?
2. the tables that have been replicated are not passing the updates from the subscriber to publisher althouhg I have the "propagate updates using MSDTC" option selected. There are no vertical or horizontal filters here. and the thing is that the schema was already existing and I havent given a new name for the destination table. While I was practicing I noticed that this thing happens when u usethe same name for the destination table. So how can this issue be solved bcz I really can't afford to change table names now.
thanks for ur time...
Rocky
|
|
|
|
|
i am working on project online testing system using vb.net as frontend & oracle as backend. i want to add backup facility in my project .for this i need to create a stored procedure in oracle.can someone guide me to create the procedure because i have no idea about it.
|
|
|
|
|
I need to calculate the number of weekdays between two dates in SQL. Does someone know an easy way for that?
|
|
|
|
|
Hi
Do you mean number of weeks between between two dates ?? Then use DATEDIFF() function
Eg: SELECT DATEDIFF (ww, '01/01/2007',getdate() will 10 weeks
Harini
|
|
|
|
|
No, I meant the number of weekdays. For '01/01/2007' and getdate() it should return 51 (as of today). So to be more precise I need something like this in SQL:
DateTime start = new DateTime(2007, 1, 1);
int num = 0;
while (DateTime.Compare(DateTime.Today, start) == 1)
{
int day = (int)start.DayOfWeek;
if (day > 0 && day < 6)
num++;
start = start.AddDays(1);
}
-- modified at 10:47 Tuesday 13th March, 2007
|
|
|
|
|
I feel a bit silly now as I noticed I basically answered my own question. All I had to do is rewrite the sample provided above in SQL, using the same logic.
|
|
|
|
|
Hi
You can also try this:
SELECT DATEDIFF (dd, '01/01/2007',getdate()) - (DATEDIFF (wk, '01/01/2007',getdate()) * 2)
Harini
|
|
|
|
|
SELECT DATEDIFF (dd, '03/11/2007', '03/17/2007') - (DATEDIFF (wk, '03/11/2007','03/17/2007') * 2) returns 6 and that's wrong.
|
|
|
|
|
Hi
Check this link:
SQL Forums[^]
Copied and pasted example from the above link:
CREATE function dbo.DateDiffWeekdays
(@fromdate datetime,
@todate datetime)
RETURNS int
AS
begin
declare @procdate datetime, @enddate datetime
declare @weekdays int
set @procdate = @fromdate
set @weekdays = 0
while (@procdate < @todate)
begin
if (datepart(dw, @procdate + 1) <> 1) and (datepart(dw, @procdate + 1) <> 7)
set @weekdays = @weekdays + 1
set @procdate = dateadd(d, 1, @procdate)
end
---
if @todate is null
set @weekdays = null
return @weekdays
end
-- modified at 5:52 Wednesday 14th March, 2007
But still this is wrong, if you give between Mar 1st 2007 and March 3rd 2007
Harini
|
|
|
|
|
Actually that's very similiar to what I came up with rewriting my own code in SQL. Mine's:
CREATE FUNCTION WeekDaysBetween
(
@from datetime,
@to datetime
)
AS
BEGIN
DECLARE @num int
SET @num = 0
WHILE (DATEDIFF(day, @from, @to) > 0)
BEGIN
DECLARE @day int
SET @day = DATEPART(dw, @from)
IF (@day > 1 AND @day < 7)
SET @num = @num + 1
SET @from = DATEADD(day,1 , @from)
END
RETURN @num
END
This seems to work. Thanks for your help though.
|
|
|
|
|
Hi,
You can use SELECT with the same method you used to get the above results.
Please find this site http://www.avatto.com/ which is good for any database related queries...
|
|
|
|
|
I m using SQL Server 2005 & creating Reports using SQL Reporting.
I have one main report and one sub report.
I have called the sub report as hyperlink on one of the field from main report.
When i run the main report, i get the view properly.
But when i click on hyperlink from main report, that time i supposed to view the sub report
And i m using the input parameters to that sub reports.
But dont have any idea that how i can pass the parameters from main report dataset to sub report report dataset , in runtime !
please guide me for this..
Prakash Sawant
|
|
|
|
|
|
Hi
What is your question?? it is blank here.
Harini
|
|
|
|
|
Harini Krishnaswamy wrote: What is your question??
Read the subject line
|
|
|
|
|
Which database? I'm assuming you mean SQL Server
select name, filename from sysfiles
|
|
|
|
|
I assume you are asking for your database MDF file location , Under default installation settings, its in C:\Program Files\Microsoft SQL Server\MS SQL 1.0*\Data
* dont remember it exactly
Unless you change your installation folder, files are placed here by default (no matter if SQL 2000 and 2005 are both installed on your machine).
|
|
|
|