select row number pada postgresql
select * from
(
SELECT nim,count(*) as jml,ROW_NUMBER () OVER (ORDER BY npm) as no FROM public.data where periode='123' group by nim
) a
where a.no>=100 and a.no<=150
berusaha untuk berbagi
Kamis, 12 September 2024 Sunarto 0
select * from
(
SELECT nim,count(*) as jml,ROW_NUMBER () OVER (ORDER BY npm) as no FROM public.data where periode='123' group by nim
) a
where a.no>=100 and a.no<=150
Senin, 12 Agustus 2024 Sunarto 0
apabila mengalami error CS1056 Unexpected character '\0'
Select Tools > Command Line > Developer Command Promp
devenv /noScale
untuk membuat scala view 100%
double aakhir=0;
aakhir = Convert.ToDouble(dataReader["akhir"]);
inventory.akhir = aakhir.ToString("#,##0.00");
Selasa, 23 April 2024 Sunarto 0
string xx="90,10";
xx= xx.Replace(',', '.');
maka nilai variabel xx = "90.10"
@p.nama.ToUpper()
ToUpper() menjadikan string besar semua.
Senin, 22 April 2024 Sunarto 0
DateTime ttgl;
ttgl= Convert.ToDateTime(dataReader["tanggal"]);
TempData["tgl"] = ttgl.ToString("dddd, dd MMMM yyyy");
tampil dilayar
Monday, 22 April 2024
DateTime.Now.ToString("MM/dd/yyyy") | 05/29/2015 |
DateTime.Now.ToString("dddd, dd MMMM yyyy") | Friday, 29 May 2015 |
DateTime.Now.ToString("dddd, dd MMMM yyyy") | Friday, 29 May 2015 05:50 |
DateTime.Now.ToString("dddd, dd MMMM yyyy") | Friday, 29 May 2015 05:50 AM |
DateTime.Now.ToString("dddd, dd MMMM yyyy") | Friday, 29 May 2015 5:50 |
DateTime.Now.ToString("dddd, dd MMMM yyyy") | Friday, 29 May 2015 5:50 AM |
DateTime.Now.ToString("dddd, dd MMMM yyyy HH:mm:ss") | Friday, 29 May 2015 05:50:06 |
DateTime.Now.ToString("MM/dd/yyyy HH:mm") | 05/29/2015 05:50 |
DateTime.Now.ToString("MM/dd/yyyy hh:mm tt") | 05/29/2015 05:50 AM |
DateTime.Now.ToString("MM/dd/yyyy H:mm") | 05/29/2015 5:50 |
DateTime.Now.ToString("MM/dd/yyyy h:mm tt") | 05/29/2015 5:50 AM |
DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") | 05/29/2015 05:50:06 |
DateTime.Now.ToString("MMMM dd") | May 29 |
DateTime.Now.ToString("yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss.fffffffK") | 2015-05-16T05:50:06.7199222-04:00 |
DateTime.Now.ToString("ddd, dd MMM yyy HH’:’mm’:’ss ‘GMT’") | Fri, 16 May 2015 05:50:06 GMT |
DateTime.Now.ToString("yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss") | 2015-05-16T05:50:06 |
DateTime.Now.ToString("HH:mm") | 05:50 |
DateTime.Now.ToString("hh:mm tt") | 05:50 AM |
DateTime.Now.ToString("H:mm") | 5:50 |
DateTime.Now.ToString("h:mm tt") | 5:50 AM |
DateTime.Now.ToString("HH:mm:ss") | 05:50:06 |
DateTime.Now.ToString("yyyy MMMM") | 2015 May |
DateTime moment = DateTime.Now;
string year1 = moment.Year.ToString();
string month1 = moment.Month.ToString();
string day1 = moment.Day.ToString();
string tgll = year1 + "/" + month1 + "/" + day1;
Kamis, 18 April 2024 Sunarto 0
<td style="vertical-align: middle">Test</td>
vertical-align : middle identik dengan perintah valign="center"
Selasa, 16 April 2024 Sunarto 0
double CPLPersen= 30.10;
TempData["CPLPersen"] = CPLPersen.ToString("#,##0.00");
Jumat, 12 April 2024 Sunarto 0
perintah IIF dalam MS-SQL
select iif(praktikum is null,'Kuliah','Praktikum') as jenisKuliah from kuliah
artinya jika field berisi null maka jenisKuliah berisi kata Kuliah, sebaliknya jika tidak null maka berisi Praktikum
Install NuGet
Project - Manage NuGet
MySQL Data (Install)
Test Koneksi
using MySql.Data.MySqlClient;
MySql.Data.MySqlClient.MySqlConnection myConnection;
string myConnectionString;
myConnectionString = "server=server;uid=user;pwd=password;database=database";
try
{
myConnection = new MySql.Data.MySqlClient.MySqlConnection(myConnectionString);
myConnection.Open();
MySqlCommand myCommand = new MySqlCommand();
myCommand.Connection = myConnection;
myCommand.CommandText = @"SELECT * FROM GudangWHERE field = @param;";
myCommand.Parameters.AddWithValue("@param", "123445");
using var myReader = myCommand.ExecuteReader();
{
while (myReader.Read())
{
TempData["Nama"]= myReader.GetString("nama");
}
}
myConnection.Close();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
TempData["Nama"]= ex.Message;
}
Kamis, 11 April 2024 Sunarto 0
ALTER TABLE tabel123
ADD NewColumn1 UNIQUEIDENTIFIER
CONSTRAINT DF_T_Account_NewColumn1 DEFAULT (newid()) WITH VALUES
Selasa, 09 April 2024 Sunarto 0
ALTER TABLE dataIABEE
ALTER COLUMN iabeeID [uniqueidentifier] NOT NULL;
ALTER TABLE dataIABEE
ADD PRIMARY KEY (iabeeID);
drop INDEX dataIABEE.idx_dataIABEE
CREATE UNIQUE INDEX idx_dataIABEE
ON dataIABEE (kode_kul,kelas,semester,fakjur);