|
soni uma wrote: Actually it is depend on the your page server controls
It can depend on a lot more than that.
|
|
|
|
|
Yes It is Depend on the Many things like time taken by sql query,No of Records and Ect
|
|
|
|
|
briogene wrote: The problem is that on loading some Forms that retrieve the data from the Database Via the dataset it takes too much time what could be the problem
There are a million and one things that could be the problem. But without a better description from you it makes it hard to us to diagnose.
Some things to look at:
How long does the query take to run in SQL Server itself?
How much data is being transferred? What are you doing to it before the user gets to see it?
Do you need a DataSet? Would a forward-only read-only view be more efficient?
|
|
|
|
|
You can use Threads so the form will not lock up.
|
|
|
|
|
Ian Uy wrote: You can use Threads so the form will not lock up
That doesn't really solve the root problem.
|
|
|
|
|
create proc sp_temp @columnname varchar(25),@value varchar(25) as
declare @sql nvarchar(400)
set @sql='select *from tblname where '+@columnname+' = '+@value
exec(@sql)
This is the code. This procedures works for integer value when I insert in @value but for a string value; it gives invalid column name. Can anyone help me out
-- modified at 2:50 Monday 29th October, 2007
Regards,
LEE
|
|
|
|
|
Just check your table detail. It will be because of you have defined the column name as int while creating the table.
|
|
|
|
|
ok, Now i got your problem and your solution is given here.
set @sql='select *from tblname where '+@columnname+' = '+''''+@value+''''
I have tried it and its working.
|
|
|
|
|
Print your SQL query before executing, you will get the problem.
|
|
|
|
|
Try This it's help u
set @sql='select * from jc_student_master where '+@columnname+' = '''+@value+''' '
|
|
|
|
|
If you are using EXEC command to execute a sql String then the parameter has to converted into Character and made as a part of the query before execution.
try this...
set @sql = 'select * from tblname where ' +
@columnname + ' = ' + CAST(@value AS NVARCHAR(50))
EXEC(@sql)
Regards - J O H N -
|
|
|
|
|
Let me have table name tblname which has empid and empname. In the paramater @columnname empid and @value(int) this query gets the perfect output. But If I use @columnname empname and @value as string; then it gives invalid column name
Regards,
LEE
|
|
|
|
|
ok I suggest you a better way of doing this. In sql Server we have one method of executing Dynamic Sql using sp_executesql which does a parameter substution based on the parameter definition.Let us do something like this to solve your problem...
create proc sp_temp
@columnname varchar(25),
@value varchar(25)
as
DECLARE @SQLQuery AS NVARCHAR(500)
DECLARE @ParameterDefinition AS NVARCHAR(100)
set @SQLQuery = 'select * from tblname where (1=1) AND '
IF @columnname = 'EmpID'
BEGIN
set @SQLQuery = @SQLQuery + @columnname + ' = @value'
SET @ParameterDefinition = '@value INT'
END
IF @columnname = 'EmpName'
BEGIN
set @SQLQuery = @SQLQuery + @columnname + ' = @value'
SET @ParameterDefinition = '@value NVARCHAR(25)'
END
EXECUTE sp_executesql @SQLQuery, @ParameterDefinition, @value
GO
Here in the above procedure I build the ParameterDefinition list with the appropriate Datatype based on the column name. And the sp_executesql would automatically do a parameter substitution based on the DataType. Jus check it out whether it works...
Regards - J O H N -
|
|
|
|
|
hi all,
In our code,SQL DMO objects(Sql 2000)are used in the VB components.
Now we are doing SQl 2005 upgradation.when i ran the same component in SQl 2005, i got the following error.
To connect to this server you must use SQL Server Management Studio or SQL Server Management Objects (SMO) .I read in an article that we have to reregister SQL-DMO 2005 version.but i have to change that DMO object to SMO in code.
Plz give suggestions on how to convert DMO to SMO.
Thanks in advance,
cheers
sangeet
|
|
|
|
|
You need the SQL Server 2005 Backward Compatibility Components package. You can find this at the latest 'Feature Pack' download. The last update was in February 2007 which can be found here[^].
SMO - Server Management Objects - is a set of .NET components that perform much the same function as DMO.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
|
The sp_who2 internal procedure provides the following information:
Spid—The system process ID.
status—The status of the process (e.g., RUNNABLE, SLEEPING).
loginame—Login name of the user.
hostname—Machine name of the user.
blk—If the process is getting blocked, this value is the SPID of the blocking process.
dbname—Name of database the process is using.
Cmd—The command currently being executed (e.g., SELECT, INSERT)
CPUTime—Total CPU time the process has taken.
DiskIO—Total amount of disk reads for the process.
LastBatch—Last time a client called a procedure or executed a query.
ProgramName—Application that has initiated the connection (e.g., Visual Basic, MS SQL Query Analyzer)
You can use them.
Arun Singh
Noida.
|
|
|
|
|
thank for your reply.Thank a lot
|
|
|
|
|
Hi,
I have to create a SQL CE database file (*.sdf) on my PC. I intended to call several web services to get data and create a 'localDB.sdf' with a program running on my PC. I have created windows application project but I could not add reference to the System.Data.SqlServerCE assembly.
The System.Data.SqlServerCe didn't appear in the .net references tab. I had browsed and added the assembly manually but it didn't work because my framework is 2.0 and the assembly looks for CF 2.0.
How can I use the SqlCeEngine class in a Windows application? Or can I create a *.sdf file using a different class?
thanks,
- ferudun
|
|
|
|
|
Don't cross post.
You've asked this same question in 4 different forums, all within a 10 minute time span.
The people here answer questions on a volunteer basis and may not respond in a timeframe you desire or find acceptable.
I've responded to your initial message here[^].
|
|
|
|
|
You need the desktop version of the runtime. The best place to start is probably the "Compact Edition Developer SDK"[^].
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Hi,
How can I prevent users of a computer from viewing records and fields of my DB in Enterprise Manager (or SQL Server Management Studio) installed on the computer?
Like access files that can set password for them, is there any way to protect DB in SQL Server ?
Best wishes
|
|
|
|
|
You have to play around with user privileges for the table and columns.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
hspc wrote: In addition, SQL Server 2005 encryption can be used
Yep. I'll have to look at those links later.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|