visual c# update ms sql table from query inside txt file

 // MessageBox.Show(Text_malzeme_grubu.EditValue.ToString());
            //  string connectionString = null;
            SqlConnection connectionString = new SqlConnection("Server = " + ondegerler.SQLBAGLANTISI_KAYNAK + "; Database = " + ondegerler.SQLBAGLANTISI_VERITABANI + "; User Id = " + ondegerler.SQLBAGLANTISI_KULLANICI + "; Password = " + ondegerler.SQLBAGLANTISI_PAROLA);
            connectionString.Open();
            FileInfo file = new FileInfo(Application.StartupPath + "\\tbl_cari_kartlari_duzenle_kaydet.txt");
            string duzenle = file.OpenText().ReadToEnd();
            //MessageBox.Show(silinecekkod.ToString());
            SqlCommand sqlcom = new SqlCommand(duzenle, connectionString);
            sqlcom.Parameters.AddWithValue("@cari_turu", Text_cari_turu.Text.Trim());
            sqlcom.Parameters.AddWithValue("@cari_adi", Text_cari_adi.Text.Trim());
            sqlcom.Parameters.AddWithValue("@irtibat", Text_irtibat.Text.Trim());
            sqlcom.Parameters.AddWithValue("@adres", Text_adres.Text.Trim());
            sqlcom.Parameters.AddWithValue("@paremetre", text_paremetre.Text.Trim());
            sqlcom.Parameters.AddWithValue("@cari_kodu", Text_cari_kodu.Text.Trim());




            sqlcom.ExecuteNonQuery();
            connectionString.Close();
            MessageBox.Show("Cari Başarıyla Düzenlendi!", "CARİ KARTI DÜZENLEME", MessageBoxButtons.OK, MessageBoxIcon.Information);
/*txt file =*/
update tbl_cariler
set cari_turu=@cari_turu , cari_adi = @cari_adi ,irtibat=@irtibat , adres = @adres, paremetre = @paremetre
where cari_kodu = @cari_kodu

gridview connect to ms sql with txt file query and get data to gridview with summary

  string connectionString = null;
            SqlConnection cnn;
            connectionString = "Server = " + ondegerler.SQLBAGLANTISI_KAYNAK + "; Database = " + ondegerler.SQLBAGLANTISI_VERITABANI + "; User Id = " + ondegerler.SQLBAGLANTISI_KULLANICI + "; Password = " + ondegerler.SQLBAGLANTISI_PAROLA;
            FileInfo file = new FileInfo(Application.StartupPath + "\\tbl_cariler.txt");
            string script = file.OpenText().ReadToEnd();
            cnn = new SqlConnection(connectionString);
            SqlDataAdapter da = new SqlDataAdapter(script, cnn);
            DataTable dt = new DataTable();
            da.Fill(dt);
            gridControl1.DataSource = dt;
            gridView1.Columns[1].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count;
            gridView1.Columns[1].SummaryItem.DisplayFormat = "Adet = {0}";

            gridView1.Columns["Bakiye"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
            gridView1.Columns["Bakiye"].SummaryItem.DisplayFormat = "Toplam = {0}";
            gridView1.BestFitColumns();

Devexpress grid databar

            GridFormatRule gridFormatRule = new GridFormatRule();
            FormatConditionRuleDataBar formatConditionRuleDataBar = new FormatConditionRuleDataBar();
            gridFormatRule.Column = gridView1.Columns[“Bakiye”];
            formatConditionRuleDataBar.PredefinedName = “Blue Gradient”;
            gridFormatRule.Rule = formatConditionRuleDataBar;
            this.gridView1.FormatRules.Add(gridFormatRule);

Devexpress gridview export to excel with savefiledialog

            string filename;
            saveFileDialog1.Filter = "xlsx files (*.xlsx)|*.xlsx";
            saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.ShowDialog();
            filename = saveFileDialog1.FileName;
            if (filename == "") filename = "";
            else
            {
                gridView1.ExportToXlsx(filename);
                System.Diagnostics.Process.Start(filename);
            }

VISUAL STUDIO 2013 VISUAL BASIC GRIDE EXCELDEN YAPIŞTIR

VISUAL STUDIO 2013 VISUAL BASIC GRIDE EXCELDEN YAPIŞTIR

ONCE BU FONKSIYONU EKLE;
———————-
Sub pastefromclipboardtodatagridview(ByVal dgv As DataGridView)
        Dim rowSplitter As Char() = {vbCr, vbLf}
        Dim columnSplitter As Char() = {vbTab}

        ‘get the text from clipboard

        Dim dataInClipboard As IDataObject = Clipboard.GetDataObject()
        Dim stringInClipboard As String = CStr(dataInClipboard.GetData(DataFormats.Text))

        ‘split it into lines
        Dim rowsInClipboard As String() = stringInClipboard.Split(rowSplitter, StringSplitOptions.RemoveEmptyEntries)

        ‘get the row and column of selected cell in grid
        Dim r As Integer = dgv.SelectedCells(0).RowIndex
        Dim c As Integer = dgv.SelectedCells(0).ColumnIndex

        ‘add rows into grid to fit clipboard lines
        If (dgv.Rows.Count < (r + rowsInClipboard.Length)) Then
            dgv.Rows.Add(r + rowsInClipboard.Length – dgv.Rows.Count)
        End If

        ‘ loop through the lines, split them into cells and place the values in the corresponding cell.
        Dim iRow As Integer = 0
        While iRow < rowsInClipboard.Length
            ‘split row into cell values
            Dim valuesInRow As String() = rowsInClipboard(iRow).Split(columnSplitter)
            ‘cycle through cell values
            Dim iCol As Integer = 0
            While iCol < valuesInRow.Length
                ‘assign cell value, only if it within columns of the grid
                If (dgv.ColumnCount – 1 >= c + iCol) Then
                    dgv.Rows(r + iRow).Cells(c + iCol).Value = valuesInRow(iCol)
                End If
                iCol += 1
            End While
            iRow += 1
        End While

    End Sub

—————

1 ADET DATAGRIDVIEW YARAT
1 ADET BUTTON YARAT
CİFT TIKLA BUTTONA
KOD:
        DataGridView1.AllowUserToAddRows = False
        DataGridView1.Rows.Add()
        pastefromclipboardtodatagridview(DataGridView1)
        DataGridView1.AllowUserToAddRows = False
        DataGridView1.Rows.Add()
        pastefromclipboardtodatagridview(DataGridView1)

vs 2013 c# Devexpress gridview sağ tıklayarak excel dosyası olarak kaydet

Forma 1 adet contextMenuStrip1 ve 1 adet saveFileDialog1 at gridControl1de ki dataları excele kaydetmek için;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.OleDb;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Grid;

contextMenuStrip1  tıkla Excele kaydet item yarat ve çift tıkla ve yaz;

            //excele kaydet
            string filename;
            saveFileDialog1.Filter = “xlsx files (*.xlsx)|*.xlsx”;
            saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.ShowDialog();
            filename = saveFileDialog1.FileName;
            if (filename == “”) filename = “”; else gridView1.ExportToXlsx(filename);

Daha sonra gridcontrola tıkla ve contextmenustripini contextMenuStrip1 olarak seç

Visual C# 2013 Windows 7 Programa taskabara kısayollar ekleme IKONLU

 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Taskbar;
using Microsoft.WindowsAPICodePack.Shell;
using System.IO;
using System.Reflection;
using System.Diagnostics;







             private void Form1_Shown(object sender, EventArgs e)
        {
            //KISAYOLLAR DOSYA YOLLARI
            string VP = "D:\\Dosyalar\\semih\\visionpluskontrol32bit\\VisionPlusKontrol32bit\\VisionPlusKontrol32bit\\bin\\Debug\\VisionPlusKontrol32bit.exe";
            string OTOMASYON = "D:\\vs 2013 projeleri\\vp\\vpws\\vpws2\\EasyEkontor3g\\EasyEkontor3g\\bin\\Debug\\EasyEkontor3g.exe";
            string DOSTELWEB = "http://182.125.142.9/ws/";
            string DOSTELWEBICONIE = "C:\\Program Files\\Internet Explorer\\iexplore.exe";

            //SIK KULLANILANLAR DOSYA YOLLARI
            string COREL = "C:\\Program Files\\Corel\\CorelDRAW Graphics Suite X6\\Programs64\\CorelDRW.exe";
            string PHOTOSHOP = "D:\\Program Files\\Adobe\\Adobe Photoshop CC 2015\\Photoshop.exe";
            string DOSYALARVEBOYUTLAR = "D:\\Program Files (x86)\\WinDirStat\\windirstat.exe";
            string SEARCHEVERYTHING = "D:\\Program Files\\Everything\\Everything.exe";
            string SMSCASTER = "C:\\Program Files (x86)\\SMSCaster\\smscaster.exe";

            JumpList KISAYOLLAR = JumpList.CreateJumpList();
            KISAYOLLAR.ClearAllUserTasks();
            JumpListLink JLLVP = new JumpListLink(VP, "VP") { IconReference = new IconReference(VP, 0) };
            JumpListLink JLLOTOMASYON = new JumpListLink(OTOMASYON, "OTOMASYON") { IconReference = new IconReference(OTOMASYON, 0) };
            JumpListLink JLLDOSTELWEB = new JumpListLink(DOSTELWEB, "DOSTEL WEB") { IconReference = new IconReference(DOSTELWEBICONIE, 0) };
            JumpListCustomCategory kategori = new JumpListCustomCategory("KISAYOLLAR");
            kategori.AddJumpListItems(JLLVP);
            kategori.AddJumpListItems(JLLOTOMASYON);
            kategori.AddJumpListItems(JLLDOSTELWEB);
            KISAYOLLAR.AddCustomCategories(kategori);

            JumpListLink JLLCOREL = new JumpListLink(COREL, "COREL X6") { IconReference = new IconReference(COREL, 0) };
            JumpListLink JLLPHOTOSHOP = new JumpListLink(PHOTOSHOP, "PHOTOSHOP 2015") { IconReference = new IconReference(PHOTOSHOP, 0) };
            JumpListLink JLLDOSYALARVEBOYUTLAR = new JumpListLink(DOSYALARVEBOYUTLAR, "WINDIRSTAT DOSYA BOYUTLARI") { IconReference = new IconReference(DOSYALARVEBOYUTLAR, 0) };
            JumpListLink JLLSEARCHEVERYTHING = new JumpListLink(SEARCHEVERYTHING, "SEARCH EVERYTHING") { IconReference = new IconReference(SEARCHEVERYTHING, 0) };
            JumpListLink JLLSMSCASTER = new JumpListLink(SMSCASTER, "SMS CASTER") { IconReference = new IconReference(SMSCASTER, 0) };
            JumpListCustomCategory kategori2 = new JumpListCustomCategory("SIK KULLANILANLAR");
            kategori2.AddJumpListItems(JLLCOREL);
            kategori2.AddJumpListItems(JLLPHOTOSHOP);
            kategori2.AddJumpListItems(JLLDOSYALARVEBOYUTLAR);
            kategori2.AddJumpListItems(JLLSEARCHEVERYTHING);
            kategori2.AddJumpListItems(JLLSMSCASTER);
            KISAYOLLAR.AddCustomCategories(kategori2);
            KISAYOLLAR.Refresh();
        }

VB .NET’de Yazı özgünleştirme ve özgünleştirme testi yapma kodları SEO

Forma eklenmesi gerekenler; Kaynak kodları için bana ulaşabilirsiniz…

Kodlar:

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        WebBrowser1.Document.GetElementById(“makale”).SetAttribute(“value”, MemoEdit1.Text)
        ‘WebBrowser1.Document.GetElementById(“İşlemi Yap”).InvokeMember(“click”)

        ‘kontor attıktan sonra cıkan ekranda tamamama bas
        For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName(“input”)

            If Element.OuterHtml.Contains(“İşlemi Yap”) Then

                Element.InvokeMember(“click”)
                Exit For

            End If

        Next Element
        WebBrowser2.Navigate(“http://www.jetseotools.com/free-seo-plagiarism-checker&#8221;)
        Timer1.Enabled = True

 

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName(“input”)

            If Element.OuterHtml.Contains(“Demo Göster”) Then

                Element.InvokeMember(“click”)
                Exit For

            End If

        Next Element

        Timer1.Enabled = False
        Timer2.Enabled = True
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick

        Dim Elems As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName(“textarea”)
        For Each Elem As HtmlElement In Elems
            ‘Loop through until you find the one that needs updating (in your case it is named proxylist)
            If Elem.Id = “demo” Then
                ‘Update the TextArea Text
                ‘   Elem.InnerHtml = “My Text”
                MemoEdit2.Text = Elem.InnerHtml
                Exit For
            End If
        Next Elem
        MemoEdit2.Text = Split(MemoEdit2.Text, “kelime say”)(0)
        Timer2.Enabled = False
        Timer3.Enabled = True
    End Sub

    Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
        Dim Elems As HtmlElementCollection = WebBrowser2.Document.GetElementsByTagName(“textarea”)
        For Each Elem As HtmlElement In Elems
            ‘Loop through until you find the one that needs updating (in your case it is named proxylist)
            If Elem.Id = “mycontent” Then
                ‘Update the TextArea Text
                ‘   Elem.InnerHtml = “My Text”
                Elem.InnerHtml = MemoEdit2.Text
                Exit For
            End If
        Next Elem

        For Each Element As HtmlElement In WebBrowser2.Document.GetElementsByTagName(“a”)

            If Element.OuterHtml.Contains(“Check for Plagiarism”) Then

                Element.InvokeMember(“click”)
                Exit For

            End If

        Next Element
        WebBrowser2.Focus()
        SendKeys.Send(“^-“)

        WebBrowser1.Navigate(“http://wmtikk.com/arac/yazi-ozgunlestirici&#8221;)

        Timer3.Enabled = False
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim fileReader As System.IO.StreamReader
        fileReader =
        My.Computer.FileSystem.OpenTextFileReader(“saniye.txt”)
        Dim stringReader1 As String

        stringReader1 = fileReader.ReadLine()
        Timer1.Interval = stringReader1

    End Sub
End Class

vb net klasöürdeki dosya bilgilierini listboxa yazdırmak için

1 Dim finfo As New IO.DirectoryInfo("C:\Story")
2 For Each fi In finfo.GetFiles
3   Listbox1.Items.Add(fi.FullName)
4 Next
ayrıca textboxun multilineni acıncada yapılabilir
1 Dim finfo As New IO.DirectoryInfo("C:\Story")
2 For Each fi In finfo.GetFiles
    TextBox2.AppendText(myFolder & sFileExtension & Environment.NewLine) ‘pcye kaydedilen yer

Next

[VB.net] How to make a Firefox Webbrowser

This tutorial will teach you how to make a Firefox Webbrowser. Unlike the Internet Explorer (default one) this one is faster and better.

Requirements

1. Visual Basic
2. Coding Experience in vb.net
3. A Brain

Tutorial

1. First go to http://webkitdotnet.sourceforge.net/downloads.php and click on Win32 Binary File
[​IMG]

2. Open the download zip using 7-zip or some archiver.
3. Extract it to a local directory.
4. Open Visual Basic (or Visual Studio)
5. Click on New Project
[​IMG]

6. Create a new project
7. You will see a window similar like this.
[​IMG]

8. Click on Tools > Choose Toolbox Items
[​IMG]
9. Click on browse and locate to the folder where you extracted the zip file.
10. Go to Extracted Folder > bin > WebKitBrowser.dll
11. Click ok
12. Save Project
13. Copy all files from the directory of Webkit
[​IMG]

14. Go to your Project Folder.
15. Navigate to C:\Users\”YOUR USERNAME”\Documents\Visual Studio 2010\Projects\”PROJECT NAME”\”PROJECT NAME”\bin\Debug folder
16. Paste it there.
17. Now go back to the project
17a. Check your Toolbox.
17b. You will find there is a Webbrowser Control is the last section of the Toolbox. Add it to your program.
18. Double click the form.
[​IMG]

19. Type the following code.
[​IMG]

20. Now test your project.
21. You will get something like this.
[​IMG]

I know most of you will make a bot using this tutorial and go on with your life :alone: but giving a thanks and rep is highly appreciated.:thumbs:

ref http://thebot.net/threads/vb-net-how-to-make-a-firefox-webbrowser.142359/