مجيد اطلس باف

Majid Atlasbaf
91 - پیام , 188 - نظر

پیوندهای اصلی

اخبار


Page Rank Tool

بایگانی پیامها

بایگانی سال ۱۳۸۸

فروردین ۱۳۸۸، (۱)

بایگانی سال ۱۳۸۷

دی ۱۳۸۷، (۱)
آذر ۱۳۸۷، (۱)
آبان ۱۳۸۷، (۱)
مهر ۱۳۸۷، (۱)
شهریور ۱۳۸۷، (۱)
مرداد ۱۳۸۷، (۱)
تیر ۱۳۸۷، (۱)
خرداد ۱۳۸۷، (۱)
اردیبهشت ۱۳۸۷، (۱)
فروردین ۱۳۸۷، (۱)

بایگانی سال ۱۳۸۶

اسفند ۱۳۸۶، (۱)
بهمن ۱۳۸۶، (۳)
آذر ۱۳۸۶، (۱)
آبان ۱۳۸۶، (۱)
مهر ۱۳۸۶، (۱)
شهریور ۱۳۸۶، (۱)
مرداد ۱۳۸۶، (۲)
خرداد ۱۳۸۶، (۱)
اردیبهشت ۱۳۸۶، (۱)
فروردین ۱۳۸۶، (۲)

بایگانی سال ۱۳۸۵

اسفند ۱۳۸۵، (۱)
دی ۱۳۸۵، (۱)
آبان ۱۳۸۵، (۲)
مهر ۱۳۸۵، (۲)
شهریور ۱۳۸۵، (۳)
مرداد ۱۳۸۵، (۱)
تیر ۱۳۸۵، (۴)
خرداد ۱۳۸۵، (۱)
اردیبهشت ۱۳۸۵، (۵)
فروردین ۱۳۸۵، (۲)

بایگانی سال ۱۳۸۴

اسفند ۱۳۸۴، (۱)
دی ۱۳۸۴، (۳)
آذر ۱۳۸۴، (۵)
آبان ۱۳۸۴، (۲)
مهر ۱۳۸۴، (۷)
شهریور ۱۳۸۴، (۴)
مرداد ۱۳۸۴، (۳)
خرداد ۱۳۸۴، (۳)
اردیبهشت ۱۳۸۴، (۳)
فروردین ۱۳۸۴، (۵)

بایگانی سال ۱۳۸۳

اسفند ۱۳۸۳، (۴)
بهمن ۱۳۸۳، (۴)

دسته بندی پیامها

(rss) مطالب مرتبط با NET.
(rss) مطالب مرتبط با SQL
(rss) مطالب مرتبط با UNIX

گالری عکسها

عکسهای مقالات

سایت های مرتبط

Persian Websites Directory
DSP algorithms development

همکاران

حمیدرضا طاهریان
شیما دهباشی
فاطمه طاهریان
محسن طاهریان

۲۴ فروردین ۱۳۸۸

Identity insert does not work in SQL Server 2005 import export wizard

If you want to export data to a table which has identity column or you want to import data to such a table in management studio 2005 you should consider a precise point. First you should check "Enable identity insert" in advanced settings, but if you select "optimize for many tables" too, then the identity values for the destination table are renumbered and identity insert does not work as you expect. The cause of this problem is that "Optimize for Many Tables" creates a SSIS package which transfers the tables one-at-a-time within a For...Each looping structure and it does not include the logic to enable identity insert, so you should disable "optimize for many tables" when you have checked "Enable identity insert" option.

To read more about this subject visit the following pages:

زمان ارسال 6:44 عصر | نظرات (2)

۳۰ دی ۱۳۸۷

MySQL said: #1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

MySQL 5.1 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.0, attempts to connect to it with an older client may fail with the following message:

To solve this problem, you should use one of the following approaches:

1) Upgrade all client programs to use a 4.1.1 or newer client library.

2) When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.

3) Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:

mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

Alternatively, use UPDATE and FLUSH PRIVILEGES:

mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
-> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;

To read more about this subject visit the following pages:

زمان ارسال 8:22 صبح | نظرات (3)

۵ آذر ۱۳۸۷

Date Format in SQL Server

Previously I had a problem with my ASP .NET program which it's returned date format was not the appropriate one. As I've mentioned in the "Date Format in ASP .NET Web Application Served by IIS 6" post you can adjust your application date format with "globalization" element in "web.config", but I had another problem, although I changed the date format in my application but I had a problem when I wanted to submit a query to sql server and I got the following error when my query had a date in it's code:

"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated."

After searching a bit I found that the cause of this problem is the sql server date format. Although I had changed my application culture to "en-US" but my sql server default language was different. To find out your sql server default language, you can run the following query:

use master;
select
name, alias, dateformat from syslanguages
where langid = (select value from master..sysconfigures where comment = 'default language')

The above query shows your sql server default language. But your database user might have another language. If you select "default" for user language during user creation, then the language of user will be set to the database default language, but you can select another language for your database user. To find out what is the default language for your database user, you should login with that user to the database and run the following command:

DBCC USEROPTIONS

the above query shows you the database user default language and dataformat.

After you have found that the user date format is not appropriate for you, you can change it by the following query:

EXEC sp_defaultlanguage 'USERNAME', 'english'

The above query changes the language of specified user to "english".

If you want to get information about a language properties in sql server (such as it's date format, month names, ...) you can run the following stored procedure:

sp_helplanguage

or you can specify your desired language as follows:

sp_sp_helplanguage english

So after changing my application culture to "en-US" using the globalization element in web.config and changing my sql server user language to "us_english" using the above query, all my date time problem were resolved.  :)
But there is a note about date format, if you use standard ISO date format that is "YYYYMMDD HH:MM:SS.mmm", then you will be independent of the language setting the sql database is configured in and everything works without doubt!

To read more about this subject visit the following pages:

زمان ارسال 3:49 عصر | نظرات (0)

۲۶ آبان ۱۳۸۷

How to access MySQL remotely

By default you can not connect to remote MySQL server remotely for security reasons. To enable this feature do the following steps:

1) edit /etc/my.cnf file

2) Comment or remove "skip-networking" command

3) Add "bind-address=SERVER-IP-ADDRESS" to this file

4) Restart mysql service to apply above changes

5) Grant access to a database for a remote IP and user with the following command:

GRANT ALL ON DATABASE_NAME.* TO USERNAME@'REMOTE_IP' IDENTIFIED BY 'PASSWORD'

Now the remote user should access to the specified database remotely. Note that you need to open port 3306 tcp for remote access on the server machine. If you are using linux iptables you can use the following command:

iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT

To read more about this subject visit the following pages:

زمان ارسال 8:52 صبح | نظرات (2)

۲۳ مهر ۱۳۸۷

Startup services and scripts in differenct runlevels of Debian Linux

When Linux begins to boot with its kernel, it first runs the /sbin/init program, which does some system checks, such as verifying the integrity of the file systems, and starts vital programs needed for the operating system to function properly. It then inspects the /etc/inittab file to determine Linux's overall mode of operation or runlevel. A listing of valid runlevels in Debian Linux can be seen in the following table:

0System Halt
1Single user
2Full multi-user mode (Default)
3-5Same as 2
6System Reboot

Based on the selected runlevel, the init process then executes startup scripts located in subdirectories of the /etc/rc.d directory. Scripts used for runlevels 0 to 6 are located in subdirectories /etc/rc.d/rc0.d through /etc/rc.d/rc6.d, respectively. Here is a sample directory listing of the scripts in the /etc/rc.d/rc5.d directory:

lrwxrwxrwx 1 root root 19 2008-08-07 16:02 K25Bluetooth -> ../init.d/bluetooth
lrwxrwxrwx 1 root root 13 2008-08-07 16:01 K95gdm -> ../init.d/gdm
lrwxrwxrwx 1 root root 18 2008-10-08 16:53 S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx 1 root root 15 2008-10-08 15:04 S11klogd -> ../init.d/klogd

As you can see, each filename in these directories either starts with an "S" which signifies the script should be run at startup, or a "K", which means the script should be run when the system is shutting down. If a script isn't there, it won't be run. Most Linux packages place their startup script in the /etc/init.d directory and place symbolic links (pointers) to this script in the appropriate subdirectory of /etc/rc.d. This makes file management a lot easier. The number that follows the "K" or "S" specifies the position in which the scripts should be run in ascending order. In our example, sysklogd with a value 10 will be started before klogd with a value of 11.

In Debian Linux you can use the "update-rc.d" command or you can use "rcconf" utility or install "sysvconfig" utility to configure services and scripts running in different runlevels.

To read more about this subject visit the following pages:

زمان ارسال 8:24 صبح | نظرات (0)

۳۱ شهریور ۱۳۸۷

How to get length of text field in SQL server

Sometimes it's necessary to know the length of a data column in SQL Server especially when you are working with variable length types such as varchar and text. To do this you can use simply DATALENGTH function in SQL Server. This function is used as follows:

DATALENGTH (expression)

and the parameter is an expression of any data type. This function is especially useful with varchar, varbinary, text, image, nvarchar, and ntext data types because these data types can store variable-length data. Also note that the DATALENGTH of NULL is NULL.

To read more about this subject visit the following page:

DATALENGTH (Transact-SQL)

زمان ارسال 8:47 صبح | نظرات (0)

۳۱ مرداد ۱۳۸۷

Comparison styles in SQL Server collations

A collation encodes the rules governing the proper use of characters for either a language, such as Greek or Polish, or an alphabet, such as Latin1_General. Each SQL Server collation specifies three properties:

  • The sort order to use for Unicode data types (nchar, nvarchar, and ntext). A sort order defines the sequence in which characters are sorted, and the way characters are evaluated in comparison operations.
  • The sort order to use for non-Unicode character data types (char, varchar, and text).
  • The code page used to store non-Unicode character data.

So each SQL Server collation name is broken down into these parts:

sql_::sortrules::CodePage::ComparisonStyle

Comparison style segment allows specifying a collation's case sensitivity and accent sensitivity. Case sensitivity is determined by "CI" which means "case insensitive" and "CS" which means "case sensitive". If A and a, B and b, etc. are treated in the same way then it is case-insensitive. A computer treats A and a differently because it uses different ASCII codes for them. Accent sensitivity id determined by "AS" and "AI". "AS" means "accent sensitive" that is 'á' and 'ä' are treated  differently, but "AI" means "accent insensitive" which means that all "a", "á" and "ä" are treated the same way in comparisons.

To read more about this subject visit the following pages:

زمان ارسال 9:09 صبح | نظرات (1)

۳۰ تیر ۱۳۸۷

How to stop and start network service in FreeBSD

In FreeBSD 5.0 and above you can use "netif" script to stop, start and restart the network service. But you should login as "root" before you can run this command.You can run "netif" as follows:

# /etc/rc.d/netif stop
# /etc/rc.d/netif start
# /etc/rc.d/netif restart

زمان ارسال 9:14 صبح | نظرات (1)

۳۰ خرداد ۱۳۸۷

How to get TTL of domain using nslookup

nslookup has a debug mode which shows detailed information about the domain. Just type "set debug" in nslookup command prompt and you get a lot of information about your desired domain. In the "Got answer" section of the results you can find the TTL of your domain. For example:

c:\>nslookup
>server ns2.dnslake.com
>set debug
>radcom.ir
....
Got answer:
 ANSWERS:
...
-> radcom.ir
internet address = 216.139.228.132
ttl = 60 (1 min)

زمان ارسال 8:54 صبح | نظرات (1)

۳۱ اردیبهشت ۱۳۸۷

How to transfer files between UNIX machines securely

UNIX machines like FreeBSD have a small utility called "scp" which is a utility which allows files to be copied between machines securely. Scp is an updated version of an older utility named "rcp". It works the same, except that information (including the password used to log in) is encrypted too.

The general form of this command is:

# scp source-specification destination-specification

For example:

# scp myfile myUser@sourceMachine:myFile

To copy a directory, use the -r (recursive) option. For example:

# scp -r myDir myUser@sourceMachine:myDir

To read more about this subject visit the following pages:

زمان ارسال 11:31 صبح | نظرات (0)