|
You connection looks fine , until you get an Error that is related to connection, but at the moment you said you are trying to Update but the changes does not take effect. So your connection is not a problem
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
thanks..i kinda figured out the prob.
its dat i ws using numeric key bt nt converting textbox string into integer..it wrks fyne if key is string
bt i m nt able to find a conversion
i m using CINT nd Val on primary key
bt it updates each field with the primary key???
can u sugest me on conversion???
Thanks!!!plz reply soon
|
|
|
|
|
Try something like this
Convert.ToInt32(TextBox1.Text);
Hope it help.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
ya it cnverted it
bt chek dis one out
Try
Dim i As Integer
Dim a10, a11 As OleDbParameter
Dim cmd2 As New OleDbCommand("update table1 set stream= @a11 where stdid= @a10", con)
a10 = cmd2.Parameters.Add("@a10", OleDbType.Integer, 32)
a10.Value = Convert.ToInt32(t5.Text)
a11 = cmd2.Parameters.Add("@a11", OleDbType.VarChar, 255, "stream")
a11.Value = t6.Text
con.Open()
i = cmd2.ExecuteNonQuery()
con.Close()
Label8.Text = i
Catch ex As Exception
Label1.Text = ex.Message.ToString()
End Try
if i take stream value from textbox then it wrks....so no prob with the key firld
bt @a11 with stream is not wrking...
i think sm think is wrong the way i took oledb parameters
plz chek it
|
|
|
|
|
Make sure that the Data type and Dimension Mach your Table
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
|
No! work it out yourself. It's your project not ours
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
well, thanks for the reply.
)
|
|
|
|
|
Its your project, not ours. You do it.
..and given the question, a pretty poor choice of user name, as you clearly aren't
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
This sounds much like a homework assignment. That's why you're getting the answers you are.
And they're right, even if it's not homework. If someone else writes the code for you, it's not your work you're turning in and you don't deserve to get the credit for it. And, you just doing yourself a diservice because you won't be prepared for either the next class, or the next project assignment you get.
|
|
|
|
|
Hi, I'm using ado.net to connect to an access database. There are 2 tables "Collezione", bound to dgv1, and "Mazzo", bound to dgv2.
I have a problem with a button (see below for the code) that take a row from dgv1 and copy it in the dataset2 (das2) that is linked to dgv2. When the datarow that I want to copy it's just present in dataset2 I must increase the value in the quantity field in da2 without copy the row.
The code works, but when I copy the 3th different row it stops. Same thing when I try to increase the amount of the second row that I moved :S
Where I'm wrong? Thanks for help!
Here's the code of the button:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim dr As DataRow
dr = das2.Tables("Mazzo").NewRow()
'copy the data from dgv1 to a datarow
Dim i, indexRiga1, colonne1, righeDas2 As Integer
colonne1 = dgv1.ColumnCount - 1
indexRiga1 = dgv1.CurrentRow.Index
If dgv1.SelectedRows.Count > 0 Then
For i = 0 To colonne1
dr(i) = dgv1.Item(i, indexRiga1).Value
Next
dr(11) = 1 'it's the amount index
End If
'if dataSet2 is empty, add the row
righeDas2 = das2.Tables("Mazzo").Rows.Count - 1
If righeDas2 < 0 Then
das2.Tables("Mazzo").Rows.Add(dr)
End If
'if dataSet2 is not empy, try to find if datarow is just present
For i = 0 To righeDas2
If das2.Tables("Mazzo").Rows(i).Item("Nome") = dr(1) And _
das2.Tables("Mazzo").Rows(i).Item("Col") = dr(5) And _
das2.Tables("Mazzo").Rows(i).Item("Tipo") = dr(6) Then
dr(11) = das2.Tables("Mazzo").Rows(i).Item("Giocate") + 1 'increase the amount
das2.Tables("Mazzo").Rows(i).Delete()
das2.Tables("Mazzo").Rows.Add(dr)
End If
Else
das2.Tables("Mazzo").Rows.Add(dr)
End If
Next
End Sub
|
|
|
|
|
I'd love to be able to help you, but this code doesn't make any sense and your description of what you need it to do doesn't either.
|
|
|
|
|
I try to be more clear...
I have a access database. This database have 2 tables. The first table name is "Collezione" and the second "Mazzo".
In a form I have two datagridview one called "dgv1" and the last "dgv2". The first is bound to datas that are in "Collezione" and the other to data in "Mazzo".
I make a button that copy the report selected by user from dgv1 and add it to dgv2.
the problem is that the code doesn't work
|
|
|
|
|
How can I Connect database with Disconnected Architecture?
|
|
|
|
|
Good Morning Umesh_86
I Forgive you because you are new to this Forum. But next time Before you Post you must First Google. Promise me you will never commit this offense again.
here is your Answer
http://www.google.co.za/search?hl=en&q=Introduction+to+ADO.NET+in+VB.NET&meta=[^]
Hope it helps
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Hi all
i am working on a VB.net Project. this is my first project in vb.net and i need a autocomplete textbox which return entered text id..like dropdownlist.
I have seen some properties of textbox regarding autocomplete but that not return value of entered text.
Please Help
Thanks
Jagwinder Singh
Er. Jagwinder Singh
|
|
|
|
|
You need to set AutoCompleteMode and AutoCompleteSource to do this. If you set AutoCompleteSource as CustomSource , then AutoCompleteCustomSource should also be populated with list of values.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Hi,
Please help me
How Can I get Pendrive Serial No in VB.Net.
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|
|
Dear All:
I have a problem in vb2008 that when using assembly method to call a form ,When trying to call a sub within this form vb2008 doesn't do anything.
could you help me
Thanks in advance
Aiman Farouk
|
|
|
|
|
just two days back only i solved this problem, Try this below code and this may help you to find out your solution
******This is your windows application or class library project, but it should be "Public Module"******
Public Module TestModule
Public Sub Test()
MsgBox("Test successfully completed")
End Sub
End Module
******Below Code to your Current Project******
Imports System.Reflection
******Use the below code at any event or funtions******
Dim Path As String = "......\"
Dim FileName As String = "XXXX.dll" 'Or "XXXX.exe"
Dim FileAssembly As Assembly = Reflection.Assembly.LoadFile(Path & FileName)
Dim ModuleName As String = "TestModule"
Dim SubName As String = "Test"
Dim RefType As Type = FileAssembly.GetType(FileAssembly.GetName.Name & "." & ModuleName)
Dim MyForm As Form = New Form
RefType.InvokeMember(SubName, BindingFlags.InvokeMethod, Nothing, MyForm, Nothing)
Please tell me the above codes are working or not.......
|
|
|
|
|
Thank you for your reply .
I tried it but an error displayed
System.Reflection.TargetInvocationException was unhandled
again I want to clear it I want to call a public sub declared inside the form class which I am opening through assembly
Hope to clear it for me
|
|
|
|
|
Without using any setup and deployment, how can we create the setup file using fresh code.
Please help me to find out the solution.
Thanks in Advance,
KV
|
|
|
|
|
Write code to copy your files to the appropraite places required, create and the registry keys and values you need, and modify any other configuration files. Shouldn't be too hard, just time consuming.
|
|
|
|
|
please give me any sample code
Thanks
KV
|
|
|
|
|
You Have to Create Installer Class and create CustomActions. look at this
http://www.google.co.za/search?hl=en&q=Create+Installer+Class&btnG=Google+Search&meta=[^]
Am Still Struggling in that matter too. trying to update the WebConfig.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|