Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Friday, March 23, 2012

Is it possible to enable TCP/IP connection to SQL Server programmatically? Is there any function

Anyone know? I'm making an installation package and I want my installation program (which is a custom action class inherited from Installer Class) to adjust the network configuration of SQL Server, for example enable TCP/IP. What can I do? Is that any function in SMO package that can do this for me?Hi,

that is a registry setting, you have to switch the appropiate network protocol values in this section to get it working:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Is it possible to enable TCP/IP connection to SQL Server programmatically? Is there any func

Anyone know? I'm making an installation package and I want my installation program (which is a custom action class inherited from Installer Class) to adjust the network configuration of SQL Server, for example enable TCP/IP. What can I do? Is that any function in SMO package that can do this for me?Hi,

that is a registry setting, you have to switch the appropiate network protocol values in this section to get it working:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib

HTH, Jens Suessmeyer.

http://www.sqlserver2005.desql

Monday, February 20, 2012

Is are a way to convert the SQL datetime to MFC CTime

Hi
Here is the time in SQL : 2/21/2003 12:00:00 PM (DataType :datetime)
How can i convert this into CTime .the MFC class
Help inthis regard is appreciated,
Thanks in AdvanceA datetime is not that format. It is a decimal number - that is just the way it is converted for display.

What format do you need it in to put into a CTime.|||Thanks 'nigelrivett' for replying me
Yes...I reading the date(datetime) from the Data Base as the String..I want Month,Year,Date,Hour and Minute to build the Time for my application.

i like to build the CTime as below:

CTime Ts(nYear,nMonth,nDate,nHour,nMinute,nSecond,o);

So please tell me how get the Hour,minute,Day,Year from the Data Base.

Thanks in advance,
Sirish|||try:
select getdate() as 'Original Date'
, datepart(yy,getdate()) as 'Year'
, datepart(mm,getdate()) as 'Month'
, datepart(dd,getdate()) as 'Day'
, datepart(hh,getdate()) as 'Hour'
, datepart(mi,getdate()) as 'Minute'
, datepart(ss,getdate()) as 'Second'
, datepart(ms,getdate()) as 'Millisecond'