performance
DECLARE l_start NUMBER; l_end NUMBER; BEGIN ... l_start := dbms_utility.get_time; ... l_end := round((dbms_utility.get_time - l_start) / 100, 2); dbms_output.put_line(l_end || ' seconds...'); END;
DECLARE l_start NUMBER; l_end NUMBER; BEGIN ... l_start := dbms_utility.get_time; ... l_end := round((dbms_utility.get_time - l_start) / 100, 2); dbms_output.put_line(l_end || ' seconds...'); END;
CLEAR; with t as ( select '11' num, 'string1' str, '1' DATA from dual union all select '12' num, 'string1' str, '3' DATA from dual union all select '15' num, 'string1' str, '3' DATA from dual union all select '25' num, 'string2' str, '10' DATA from dual union all select '26' num, 'string2' str, '2' DATA from dual union all SELECT '29' num, 'string2' str, '4' DATA from dual ) SELECT * FROM t WHERE num IN (SELECT MAX(num) FROM t tt WHERE t.str = tt.str);
SELECT a.index_name, b.column_name,
a.index_type, a.table_name
FROM USER_INDEXES a, USER_IND_COLUMNS b
WHERE a.index_name = b.index_name
AND a.table_name = upper('tDocument');
App_Code\GData.cs
using System;
using System.Data;
...
public class UserInfo
{
private static string pin;
public static string Pin
{
get { return pin; }
set { pin = value; }
}
private static string fio;
public static string Fio
{
get { return fio; }
set { fio = value; }
}
}
public class QData
{
...
public class GData
{
public static void SetUserInfoPIN(string pin)
{
UserInfo.Pin = pin;
}
public static string GetUserInfoPIN()
{
return UserInfo.Pin;
}
...
}
File structure in C++
typedef struct TAGRECORD
{
char DeviceName[50]; // Имяприбора
char TagName[10]; // Имяпараметра
char TagValue[50]; // Значение
time_t TagTime; // Время записи
int TagChannel; // Канал
int TagInfo; // 0 - info, 1 - control
} TAGRECORD,*LPTAGRECORD;
Read it with Pascal?
Solution >>>
Read more…
The switch statement chooses flow of control based on the evaluation of a
numeric or string comparison.The switch statement does not allow control to fall
through to the next case as in C/C++ unless the case statement is followed
immediately by another case statement. In other words, you must use a break statement
with every case statement.You can also use a goto statement, although most
programmers frown on using them. Here are two examples:
int j = 0;
int i = 1;
switch (i)
{
case 1:j = 7;break;
case 2:
case 3:j = 22;break;
default:j = 33; break;
}
…
string lastName = “”;
string text = “fred”;
switch ( text )
{
case “fred”:lastName = “Flinstone”;break;
case “barney”:lastName = “Rubble”;break;
default:lastName = “Slate”;break;
}
Getting Visitors IP Address:
There are two ways, either by using:
HttpContext.Current.Request.UserHostAddress;
or
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
The Following Line will get the IP Address of the machine instead of Proxy’s IP
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Getting Server’s IP address:
string strHostName = Dns.GetHostName ();
IPHostEntry ipEntry = Dns.GetHostByName (strHostName);
IPAddress [ ] addr = ipEntry.AddressList;
for(int i=0;i< addr.Length;i++)
{
lblServerIP.Text=lblServerIP.Text+"The Server IP address is"+addr[i].ToString()+"\n";
}
void FillDropDownLists()
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ASPGConnectionString"].ConnectionString);
SqlCommand commGetDept = new SqlCommand("select id, dept from s_dept where id in (select dept from s_users) order by dept", conn);
try
{
conn.Open();
SqlDataReader res = commGetDept.ExecuteReader();
ListDepts.DataTextField = "dept";
ListDepts.DataValueField = "id";
ListDepts.DataSource = res;
ListDepts.DataBind();
ListDepts.Items.Insert(0, "Все");
res.Close();
}
catch (SqlException sqlex)
{
//ErrMess.Text = sqlex.Message;
return;
}
catch
{
return;
}
finally
{
if (conn.State != ConnectionState.Closed) conn.Close();
}
}
Any data
——————————————————
store:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="admins" value="esetov_b, lobanov_v"/>
</appSettings>
...
get:
string admins = ConfigurationManager.AppSettings["Admins"];
Connection String
——————————————————
store
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="ASPGConnectionString" connectionString="Data Source=DS;Initial Catalog=basename;Persist Security Info=True;User ID=user;Password=psw"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
...
get
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ASPGConnectionString"].ConnectionString);
Recent Comments