|
Thank you. Please give me hint about that...
|
|
|
|
|
HI,
Which Data Type accepts both image and character in one sql column?
Thanks
|
|
|
|
|
You can store an address of image file and use a HyperLink in runtime
|
|
|
|
|
TEXT : but you have to encode the image data to base64 (ie text).
|
|
|
|
|
I want to increase the no of rows to prevent the backcolor of the Grid View
When I tried to increase DataGridrows as :
If Me.DataGridView1.RowCount < 20 Then DataGridView1.RowCount = 20
the error message :
RowCount property cannot be set on a data-bound DataGridView control.
can I deal with that to increase no of rows
jooooo
|
|
|
|
|
Since the grid is bound to a dataset, the number of rows in the dataset determine what is displayed in the grid. Why not just change the backcolor of the grid to match the backcolor of a row?
|
|
|
|
|
you are right ..
but I made alternating rows color ,, and some cells has it's own backcolor ,, then I can't make a single color
I hope you are see
jooooo
|
|
|
|
|
I guess you are just out of luck then.
|
|
|
|
|
|
hi,
I want to know if there is a way - other than backup and restore database - to transfer all the data from one database on the server to another on a local SQLServer. it has to be done daily, so that the manager will always have an updated copy of the data on his machine.
Thanks in advance
|
|
|
|
|
I guess you could set up replication to do this as well. It might be kind of a pain depending on the number of tables and things like that.
Hope that helps.
Ben
|
|
|
|
|
ok, thanks. but can you give me any site or reference so i can try the replication, because i don't know much about it,
thanks,
|
|
|
|
|
Have you tried using Google.
|
|
|
|
|
|
How complicated is your database? You could use SMO and transfer to move the database to the new database. The transfer method is a little gimpy, but pro grammatically it allows you to move the entire database and relations to a different server.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
I need some help.
I want to create a dropdownlist with the options "Day" "Week" and "Month". I need to write a stored procedure so that if the user selects "Day" then he only queries the day(Today), if he selects "Month" he must get the data for the month.
How will I go about doing this? I know I should use the If...Else or CASE in C#. I want to know how the Stored Procedure will look?
Thanks Guys !!! and GALS!!!
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
Here you go, this is really simple and you should consider doing better date arith with DAY using CONVERT
<br />
create proc myproc <br />
<br />
@Type as varchar(10)<br />
<br />
AS<br />
BEGIN<br />
<br />
if @Type = 'DAY'<br />
BEGIN<br />
select * <br />
from table<br />
Where YEAR(DATE) = YEAR(getdate())<br />
and MONTH(DATE) = MONTH(getdate())<br />
and DAY(DATE) = DAY(getdate()) <br />
END<br />
<br />
if @Type = 'MONTH'<br />
BEGIN<br />
select * <br />
from table<br />
Where YEAR(DATE) = YEAR(getdate())<br />
and MONTH(DATE) = MONTH(getdate())<br />
END<br />
<br />
<br />
if @Type = 'YEAR'<br />
BEGIN<br />
select * <br />
from table<br />
Where YEAR(DATE) = YEAR(getdate())<br />
<br />
END<br />
<br />
<br />
<br />
END<br />
go<br />
<br />
|
|
|
|
|
Hi Friend'z...
I need to update the database tables though datagrid only.(in windows form c#).
How can I update the database through datagrid ? pl help me in doing this.
thanks in advance,
|
|
|
|
|
is it a datagrid or datagridView?
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
It is Datagrid,
i'm using Visual Studio.Net 2003
pl help me...
|
|
|
|
|
Hi,
I have a sp where in few values would be passed as input parameters, now using these values insertion opertion should be done for 11 tables.
Now if anyone insert statement fails it need not perform the remaining insert statements.
What i've done:
begin transaction
insert
insert
insert
insert...
....
...
11statements total
if(@@error<>0)
rollback transaction
else
commit transaction
Is this correct! this is leading to some problems, like other users if trying to use any of the tables i used it is giving errors
Gautham
|
|
|
|
|
it seems correct to me, I always use
IF @@ERROR <> 0
BEGIN
ROLLBACK TRANSACTION TRANS
END
COMMIT TRANSACTION TRANS
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
The value of @@ERROR is reset after every SQL statement. You should either use the new SQL-Server 2005 Try-Catch mechanism, or have checks on @@ERROR after each of your insert statements (in which case I would normally use a GOTO to jump to a rollback at the end of the procedure).
What errors are you getting?
|
|
|
|
|
Hi,
My name is srinivasan and I am new to this DTS concept.
I have to execute the DTS package from the C#.Net Code behind.
I managed to create a small DTS Package in SQL server and execute it from SQL Server Enterprise Manager.
But I can not execute that Package from C#.Net.
Can any one help?
I’ve written a small Class for Executing the DTS but it's not working.
CLASS: Class1
Function: DtsPackage()
---------------------------------------
public void DtsPackage()
{
try
{
Package2Class Package = new Package2Class();
object pVarPersistStgOfHost = null;
Package.LoadFromSQLServer
("<server name>","<user name>","<password>",DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection,"","","","Test Package",ref pVarPersistStgOfHost);
Package.Execute();
Package.UnInitialize();
System.Runtime.InteropServices.Marshal.ReleaseComObject(Package);
Package = null;
}
--------------------------------------------------
And when I execute this I am getting an error.
__________________________________________________________________
ERROR:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
__________________________________________________________________
What could be the reason?
The 'server name', 'user name' and the 'password' was also correct.
Server name is SQL Server's Name.
User Name is SQL Server's User Name.
Password is SQL Server's Password.
Thank you in advance,
Seenu.
SrinivasanPrabakaran.
Trainee Software Engineer.
Metrica Systems.
Bangalore.
|
|
|
|
|
Hi All
Perhaps someone can advise on a better solution to my problem ?
I have a table full of call (telephone) records, each record has the duration of the call made
the duration is in seconds
i.e
Call table
Call id, duration, telephonenumber
1 89 0122222222222
2 135 0192929292929
3 31 0121122211111
4 5....etc etc
what i need to do i go through each record and convert the duration to a time format
so
for call id 1, the result would be 01:29,
for 2, result would be 02:15
for 3, result would be 00:31
for 4, result would be 00:05
at the moment, below is what i am doing within a cursor for each row, and although it works fine
it is a really slow way of doing things, and when i have to go through a few million records you can imagine this takes quite a while
Can anyone suggest a quicker alternative ?
Hope that all makes sense ?
Simon
set @CounterVariable = 1
set @hours = 0
set @mins = 0
set @time_counter = 0
WHILE (@CounterVariable <= @dur)
BEGIN --- count the hours
set @CounterVariable = @CounterVariable + 1
set @time_counter = @time_counter +1
IF @time_counter = 60
BEGIN
set @hours = @hours + 1
set @time_counter = 0
END
END
--- mins is remainder (seconds)
set @mins = @time_counter
IF @hours < 10 and @time_counter < 10 -- build the time string
BEGIN
set @dur_time = '0'+ CAST(@hours as varchar(2)) + ':' + '0' + CAST(@mins as varchar(2))
END
ELSE IF @hours >= 10 and @time_counter < 10
BEGIN
set @dur_time = CAST(@hours as varchar(2)) + ':' + '0' + CAST(@mins as varchar(2))
END
ELSE IF @hours < 10 and @time_counter>= 10
BEGIN
set @dur_time = '0'+ CAST(@hours as varchar(2)) + ':' + CAST(@mins as varchar(2))
END
ELSE IF @hours >=10 and @time_counter>= 10
BEGIN
set @dur_time = CAST(@hours as varchar(2)) + ':' + CAST(@mins as varchar(2))
END
|
|
|
|