muratboy31 Posted August 14, 2013 Share Posted August 14, 2013 Merhaba arkadaşlar MSSQL bağlantısı konusunda yardımcı olabilecek varmı ? Quote Link to comment Share on other sites More sharing options...
byyilmaz Posted August 14, 2013 Share Posted August 14, 2013 (edited) Sorun tam olarak belli değil. Mesala C# da msql bağlatı mı yapamıyorsun ne yapıyorsun onu açıklarsan yardımcı olmaya çalışırız. Edited August 14, 2013 by byyilmaz Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 14, 2013 Author Share Posted August 14, 2013 (edited) Yane AMS'de Mssql nasıl bağlanılır, tablo dan veri nasıl çekilir gibi... Edited August 14, 2013 by muratboy31 Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 14, 2013 Share Posted August 14, 2013 Sorun tam olarak belli değil. Mesala C# da msql bağlatı mı yapamıyorsun ne yapıyorsun onu açıklarsan yardımcı olmaya çalışırız. hangi bölümde olduğunun farkında mısın acaba? Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 14, 2013 Editor Share Posted August 14, 2013 Odbc plugini ile baglanila bilir diye tahmin ediyorum Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 14, 2013 Author Share Posted August 14, 2013 local conn = luacom.CreateObject("ADODB.Connection") if conn then conn:Open("Driver={SQL Server}; Server=localhost; DataBase=Customers; Uid=sa; Pwd=123456") local rs = conn:Execute("SELECT * FROM user") Grid.SetColumnCount("Grid1", rs.Fields.Count); local r = 0 while not rs.EOF do r = r + 1 Grid.SetRowCount("Grid1", r+1); for i = 0, rs.Fields.Count - 1 do local fld = rs.Fields:Item(i) if fld and fld.Value then Grid.SetCellText("Grid1", r, i, fld.Value, true); end end rs:MoveNext() end rs:Close() Grid.SetRedraw("Grid1", true) end bu kodda bağlantı satırında hata veriyor , nerde yanlış yapıyprum acaba ? Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 14, 2013 Editor Share Posted August 14, 2013 Verdiği hatanın bi resmini atarmısın. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 15, 2013 Author Share Posted August 15, 2013 Veri tabanındaki tablo bu ; hatayı burada veriyormuş bağlantıda değil, tüm alanları listelemiyor nedense ! Grid.SetCellText("Grid1", r, i, fld.Value, true); kullandığım kod bu ; local conn = luacom.CreateObject("ADODB.Connection") if conn then conn:Open("Driver={SQL Server}; Server=192.168.1.3; DataBase=Forwin2013; Uid=sa; Pwd=123456") local rs = conn:Execute("SELECT * FROM KNT_SAYAC") Grid.SetColumnCount("Grid1", rs.Fields.Count); local r = 0 while not rs.EOF do r = r + 1 Grid.SetRowCount("Grid1", r+1); for i = 0, rs.Fields.Count - 1 do local fld = rs.Fields:Item(i) if fld and fld.Value then Grid.SetCellText("Grid1", r, i, fld.Value, true); end end rs:MoveNext() end rs:Close() Grid.SetRedraw("Grid1", true) end Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 15, 2013 Editor Share Posted August 15, 2013 Mssql Server olmadıgı için kontrol edemedim. Grid.SetCellText("Grid1", r, i,rs.Field[1], true); bu şekilde bir denermisin. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 15, 2013 Author Share Posted August 15, 2013 Mssql de nasıl tablo oluşturabilirim acaba ? bu şekilde denedim olmadı ... local conn = luacom.CreateObject("ADODB.Connection") if conn then conn:Open("Driver={SQL Server}; Server=192.168.1.3; DataBase=Forwin2013; Uid=sa; Pwd=123456") local rs = conn:Execute("SELECT * FROM KNT_CIKIS") while rs do TreeList.AddRow("Plugin1", rs.TRH1.."|"..rs.TRH2, nil, nil, nil); end Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 15, 2013 Editor Share Posted August 15, 2013 create table ogrenciler --Ogrenci tablo oluşturma sorgusu ( ogrId int identity(1,1) primary key, --Birincil anahtar (primary key) ve otomatik artan(identity(1,1)) adi varchar(30), soyadi varchar(30), numara int, cinsiyet varchar(5), telefon char(11) ) Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 15, 2013 Author Share Posted August 15, 2013 aslında tam olarak bu değildi sorum yanlış anlattım sanırım... Şöyle olması lazım yane ben mssql de bulunun bir tablodan veriyi alıp ams de şu şekilde bir table oluşturması; local rs = conn:Execute("SELECT * FROM KNT_CIKIS") while rs do TreeList.AddRow("Plugin1", rs.TARIH1.."|"..rs.TARIH2.."|"..rs.TARIH3, nil, nil, nil); end bu sayede istediğim gibi kullanabilirim veriyi input yada başka bir obje ile... Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 15, 2013 Editor Share Posted August 15, 2013 dönen değer table mı bilmiyorum. rs[1] olarak denermisin. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 15, 2013 Author Share Posted August 15, 2013 Hayır böyle olmadı pairs Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 15, 2013 Editor Share Posted August 15, 2013 Team verebilirmisin özelden.Mssql yok pc de sendeyken test edeyim. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 15, 2013 Author Share Posted August 15, 2013 gönderdim Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 15, 2013 Author Share Posted August 15, 2013 neden gridde 9 dan sonrası görünmüyor acaba ? kullandığım kod bu ; Grid.SetCellText("Grid1", 0, 0, "Makbuz No", true); Grid.SetCellText("Grid1", 0, 1, "Plaka", true); Grid.SetCellText("Grid1", 0, 2, "Giriş Tarihi", true); Grid.SetCellText("Grid1", 0, 3, "Çıkış Tarihi", true); Grid.SetCellText("Grid1", 0, 4, "Dorse Plaka", true); Grid.SetCellText("Grid1", 0, 5, "Müşteri", true); Grid.SetCellText("Grid1", 0, 6, "Tartım 1", true); Grid.SetCellText("Grid1", 0, 7, "Tartım 2", true); Grid.SetCellText("Grid1", 0, 8, "Net", true); Grid.SetCellText("Grid1", 0, 9, "Cins", true); Grid.SetCellText("Grid1", 0, 10, "Açıklama", true); Grid.SetCellText("Grid1", 0, 11, "Kullanıcı", true); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.