-
Fototrend
Új hozzászólás Aktív témák
-
amargo
addikt
válasz lakisoft #3002 üzenetére
static public class DecodeDatabase
{
private static SqlConnection m_DecodeConn;
public static SqlConnection DecodeConn
{
get { return DecodeDatabase.m_DecodeConn; }
}
public static void InitializeDecodeConnection()
{
m_DecodeConn = new SqlConnection();
try
{
m_DecodeConn.ConnectionString = @"Data Source=(local);Initial Catalog=MyDatabase;Integrated Security=True";
m_DecodeConn.Open();
}
catch (Exception e)
{
string s = e.Message + Environment.NewLine + m_DecodeConn.ConnectionString;
m_DecodeConn = null;
System.Windows.Forms.MessageBox.Show(s, System.Windows.Forms.Application.ProductName, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
throw e;
}
}
}
static public class Decode
{
static Decode()
{
//Inicializálja a dekód adatbázis kapcsolatot
DecodeDatabase.InitializeDecodeConnection();
}
static public string CTGetDecode(string sKey, string sTable, Languages cLanguage)
{
using (SqlCommand command = new SqlCommand())
{
command.Connection = DecodeDatabase.DecodeConn;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "dbo.GetDecode";
//command.Parameters.Add(new SqlParameter("@RETURN_VALUE",SqlDbType.Char,60));
command.Parameters.Add(new SqlParameter("@TableName", sTable));
command.Parameters.Add(new SqlParameter("@id", sKey));
object obj = command.ExecuteScalar();
if (null != obj)
{
return obj.ToString();
}
else
{
throw new ErrKeyNotFound(sKey);
}
}
}
}Így hirtelen, csak bekopiztam.. meg kicsit átírkáltam a neveket.. remélem nem felejtettem ki semmit..
Ez a lényeg.. alatta csak egy példa lekérdezés
m_DecodeConn.ConnectionString = @"Data Source=(local);Initial Catalog=MyDatabase;Integrated Security=True";
m_DecodeConn.Open();“The workdays are long and the weekend is short? Make a turn! Bike every day, bike to work too!”
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- Politika
- Counter-Strike: Global Offensive (CS:GO) / Counter-Strike 2 (CS2)
- ANNO 1800
- Nvidia GPU-k jövője - amit tudni vélünk
- Filmvilág
- GoodSpeed: Windows 11 PRO FPP (Full Packaged Product) - Retail, Box, dobozos
- Netfone
- A fociról könnyedén, egy baráti társaságban
- Xbox tulajok OFF topicja
- Revolut
- További aktív témák...
- EDIFIER R1700BTS hangfal pár makulátlan, új állapotban, 2 év hivatalos garanciával, alkalmi áron
- LG OLED55B23LA 2 Év GYÁRI GARANCIA
- Apple iPhone XR 128GB, Kártyafüggetlen, 1 Év Garanciával
- Gamer PC , i7 12700KF , RTX 3080 Ti , 64GB DDR5 , 960GB NVME , 1TB HDD
- Intel PC , i5 8500 , 1660 6GB , 32GB DDR4 , 512GB NVME , 500GB HDD
Állásajánlatok
Cég: Ozeki Kft.
Város: Debrecen
Cég: Promenade Publishing House Kft.
Város: Budapest