Új hozzászólás Aktív témák
-
Cool Face
aktív tag
válasz
h1ght3chzor #6963 üzenetére
Szia.
A 4 db radioButton közül a kijelöltet tartalmazó text-et az adatbázisba.
RadioButton-ok:
Level 1 - radioButton_lvl1
Level 2 - radioButton_lvl2
Level 3 - radioButton_lvl3
Level 4 - radioButton_lvl4
Level 5 - radioButton_lvl5Ha a fentiek közül kijelölök egyet akkor azt a text-et menti el(Level 1, Level2 etc).
A lenti kódig jutottam el. Fölösleges dolgokat kitöröltem.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace Honeywell_SDE_Application
{
public partial class PPAP_Create : Form
{
private OleDbConnection connection = new OleDbConnection();
public PPAP_Create()
{
InitializeComponent();
connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\h109536\Documents\PPAPdatabase_excel.accdb;
Persist Security Info = False; ";
}
private void HWapp_Load(object sender, EventArgs e)
{
try
{
connection.Open();
check_connection.Text = "Database Connection Succesful!";
connection.Close();
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex);
}
}
private void button3_Click(object sender, EventArgs e)
{
this.Hide();
new PPAP_Selection().Show();
}
private void button_submit_Click(object sender, EventArgs e)
{
try
{
connection.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connection;
command.CommandText = "Insert into PPAPdatabase ([PSW ID],[Part Name],[Part Number],[Part rev Level],[Drawing Number],[Drawing rev Level],[Comment (or Enovia No#)],[Supplier Name],[Date Created],[Owner],[Production Line],[Status],[Reason]) values('"+
txt_PSW_ID.Text +"','"+ txt_partname.Text +"','"+ txt_partnumber.Text +"', '"+ txt_partrevlvl.Text +"', '"+ txt_dwgnumber.Text +"', '"+ txt_dwgrev.Text +"', '"+ txt_comment.Text +"', '"+
txt_suppliername.Text +"','"+ dateTimePicker_datecreated.Text +"','"+ checkedListBox_owner.Text +"','"+ checkedListBox_prodline.Text +"', '"+ txt_status.Text + "', '"+ comboBox_PPAP.Text + "')";
command.ExecuteNonQuery();
MessageBox.Show("PPAP has been submitted");
connection.Close();
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex);
}
}
private void radioButton_lvl1_CheckedChanged(object sender, EventArgs e)
{
}
private void radioButton_lvl2_CheckedChanged(object sender, EventArgs e)
{
}
private void radioButton_lvl3_CheckedChanged(object sender, EventArgs e)
{
}
private void radioButton_lvl4_CheckedChanged(object sender, EventArgs e)
{
}
private void radioButton_lvl5_CheckedChanged(object sender, EventArgs e)
{
}
}
}
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Igényes Gamer PC - Ryzen 5 9600X - 32GB DDR5 - 512GB SSD - Asus TUF RTX 3070 Ti - Vízhűtés - 850 táp
- Lenovo ThinkPad X13 Gen 2 i5-1145G7 16GB 512GB FHD+ 100% sRGB - 1 év garancia
- Express iPhone Szerviz 6 hónap garanciával, saját futár, ingyenes tisztítás és ajándék fólia
- Lenovo Thinkpad T540p i5-4200M / 8GB ddr3/ 120gb sata ssd / töltő / akku nincs
- EPSON TM-T20III (012) Ethernet Blokknyomtató
- ÁRGARANCIA!Épített KomPhone Ryzen 7 5700X 32/64GB RAM RTX 5060 Ti 8GB GAMER PC termékbeszámítással
- Xiaomi Redmi Note 11 64GB, Kártyafüggetlen, 1 Év Garanciával
- HP ZBook Studio G7 i7-10850H 32GB 512GB Nvidia Quadro T1000 15.6" FHD 1 év garancia
- Azonnali készpénzes nVidia RTX 2000 sorozat videokártya felvásárlás személyesen / csomagküldéssel
- Lenovo Yoga Slim 7 i5-1135G7 8GB 512GB 14" FHD IPS
Állásajánlatok
Cég: FOTC
Város: Budapest
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest