Tuesday, February 26, 2013

open SQL manager

1. Use VNC remote to vas-app1 follow link Here

2. open "SQL Server Configulation Manager" by click on "Start" All Programs -> Microsoft SQL server 2008 -> Configulation Tools -> SQL Server Configulation Manager

3. now you can turn off or turn on by right-click select command

Deploy user define function for SQL server

1. right-click on project and then click properties


2. on tab database click "browse..." to select Host and database to deploy


3. if have database go to step 7 else just click Add New Reference


4. input Server name: (1), then select "Use SQL Server Authentication" input User name: and password: (2), then click "Test Connection" (3)


5. result can connect database


6. select database to deploy (1) and click "OK" (2)


7. if have data to deploy select data base connection and click "OK"


8. build project by right-click on project then click Build


9. deploy project by right-click on project then click Build


Create user define function for SQL server

1. Use VNC remote to vas-app1 follow link Here
2. Open "Microsoft Visual Studio"
3. Click File -> Open -> Project/Solution
4. open file project On D:\Application\source\CLR\OCSCLR2
5. click Solution Explorer then right-click on project
6. then click Add -> New Item...
7. Add New Item dialog will open on visual Studio installed tamplates select "User-Defined Function" and then type function name on text box Name: and click button Add to create function
8. now you can modify code.


9. sample code

using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.IO;
using System.Net;

public partial class UserDefinedFunctions
{
    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlString MODIFYBALANCE(string msisdn,string amount,string remark)
    {
        string stringResult = "";
        try
        {
            if (msisdn.StartsWith("856")) msisdn = msisdn.Substring(3);
            string sms = "http://vas-service/ocs_..........";
            string stringPost = "";// Request.Form.ToString();
            HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(sms);
            httpWebRequest.Method = "POST";
            httpWebRequest.KeepAlive = false;
            httpWebRequest.ContentLength = stringPost.Length;
            httpWebRequest.ContentType = "application/x-www-form-urlencoded";
            StreamWriter streamWriter = null;
            streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
            streamWriter.Write(stringPost);
            streamWriter.Close();
            HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
            using (StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream()))
            {
                stringResult = streamReader.ReadToEnd();
                streamReader.Close();
            }
        }
        catch (Exception ex)
        {
            stringResult = ex.Message;
        }
        return new SqlString(stringResult);
    }
};

Monday, February 25, 2013

Unlock HLR user

1. login into SQL server
select database "ReportServer"
then create new SQL script
Paste SQL command as below

list username who password password locked
select
    UserName,
    IsAnonymous,
    LastActivityDate,
    IsApproved,
    IsLockedOut,
    FailedPasswordAttemptCount
from dbo.aspnet_Users u
    inner join dbo.aspnet_Membership m on u.UserId = m.UserId
where IsLockedOut = '1'



for unlock server
update dbo.aspnet_Membership set FailedPasswordAttemptCount = 0,IsLockedOut=0
where UserId in (select UserId from dbo.aspnet_Users where UserName = 'USER_NAME')

Delete HLR user

first you need to VNC. You can follow VNC to VAS

then go to Start -> All Promgaram -> Micros -> Microsoft Viasual Studio 2005 - > Microsoft Visual studio 2005


then click on File->Open->Web site...

open web project in folder "D:\Appication\source\hlr-proj
open login.aspx
click "design"

open Administrator Webside
after web administrator open click tab "Security"
for create new HLR user just click "Manage user"


then find user that you need to delete and then click link "Delete user"


Click "Yes" to confirm delete

Create new HLR user

first you need to VNC. You can follow VNC to VAS

then go to Start -> All Promgaram -> Micros -> Microsoft Viasual Studio 2005 - > Microsoft Visual studio 2005

then click on File->Open->Web site...

open web project in folder "D:\Appication\source\hlr-proj

open login.aspx
click "design"

open Administrator Webside
after web administrator open click tab "Security"
for create new HLR user just click "Create user"

then fill all information then click button "Create User"

create new HLR user success

VNC to VAS-APP1

1. open program Run VNC Viewver


2. type Server to 192.168.150.247 then click button OK


3. type password to login aVNC then click button OK

4. remote hot will open then right-click on title bar and select send Ctrl+Alt+Del
5. type username and password  and then click button OK to access.