|
campbells wrote: is comment the this line it will have error so i remain put it in.
' cn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source= db1.mdb"
Ok, so then the constr variable that is supposed to contain the connection string doesn't? Don't use it then.
campbells wrote: and i cant remove this because it will not delete anything from my program...but i think i found the error here... when i use this code it will totally delete my whole table record... i think because i set
rr = DB.OpenRecordset("DO"), but is it possible to set rr = DB.OpenRecordset("delete * from [DO] where NO = " & dono.Text)?? i mean put sql in it.. it not really working actually.
I think that you should read up a bit on what SQL queries do and how the Recordset object works. If you want to delete the records using SQL, you don't use a recordset at all. If you want to delete the records using a recordset, you only use a select query to specify what the recordset contains.
---
b { font-weight: normal; }
|
|
|
|
|
campbells wrote: how do i put the SQL in the recordest? cause when i put rr = DB.OpenRecordset("DO"), it mean the whole table in DO.
What you are using is the command type TableDirect, meaning that you open the entire table. If you use an SQL query instead, you will be using the command type Text, meaning that the query is used to select the records for the result.
campbells wrote: ACtually my SQL to select specific record only
delete * from [DO] where NO = " & dono.Text
No, that is not a query to select records, that is a query to delete records.
---
b { font-weight: normal; }
|
|
|
|
|
Please don't remove the original post and delete your postings. You have just made the entire thread totally incomprehensible.
---
b { font-weight: normal; }
|
|
|
|
|
i work with visual basic 6 and i use crystal report 10
but there are many problems:
1- the report view the data correctly only once, when i change the data of the table that is connected to the reprot the report doesn not view the
new data
EX. when i add new matrial to the matrials table and then show the report
the report does not show the new matrial
2- how can i pass value from the FORM contrlos (textbox) to the crystal report formula
Which easy crystal or data report
please help
thanx
BE OR NOT TO BE
|
|
|
|
|
Hello,
This sounds simple and yet I am lost as to how to get this to work.
I need to get a public class (CLASS 1) with no user interface to be able to write in another Form's textBox, however I am unable to do so. I can get text to show up on initialization based on my new() call, however any subsequent timer based updates to my textbox does not write anything; I do however see my debug message at the console.
How to I get 1 class to be able to write to a text box in another class ?
Here is sample code
<pre>
Public Class EXTERNAL
Private _Timer As Timer = Nothing
Private Const TIMER_INTERVAL As Long = 5000L
Public Sub StartTimer()
_Timer.Change(0, TIMER_INTERVAL)
End Sub
Public Sub New()
ReadSchedule()
_Timer = New Timer(New TimerCallback(AddressOf timertrigger), Nothing, Timeout.Infinite, Timeout.Infinite)
StartTimer()
End Sub
Public Sub ReadSchedule()
Dim qq As Info
For Each qq In Collection
Form2.TextBox1.AppendText(Date.Now & vbTab & qq.Name)
Next
End Sub
Public Sub timertrigger(ByVal state As Object)
Dim currentTime As DateTime = DateTime.Now
Console.WriteLine(Date.Now & " Debug message loop ")
Form2.TextBox1.appendText(Date.Now & " Debug message loop ")
End Sub
End Class
</pre>
Upon initialising my CLASS EXTERNAL with a new in my form2,
form2.textbox1 has the initial values from ReadSchedule() ... however when the timer hits (every 5 seconds), I see a console output for my debug message, but the form2.textbox1 does not change.
Any suggestion would be greatly appreciated.
Sincerely
|
|
|
|
|
IMO a better way would be to have the class fire an event and then in the event handler of the host object (the form that creates the instance of your class) handle the event and write the text to the text box. You can pass the text via an event argument from your class to the host object.
Keeping in mind with the important tenants of OOP, you should build your classes with the intent to keep them completely isolated components and fully encapsulate them and what they do from anything else. Building a class that makes a direct connect (as your code does) to something else (the text box) tightly couples that class to that implementation is therefore violates good OOP principals. It makes it hard to reuse, it makes it hard to unit test and it makes it hard to maintain.
BTW, the reason you are not seeing anything happen on the host form is because you are referencing the text box NOT an instance of that text box. You could TRY passing an instance of the form into your class contrsuctor and referencing that in your timer function but then you would be violating more than good OOP because you would be acting on a GUI component outside the thread that created it.
|
|
|
|
|
hi my friend
i have this problem ??
I get this error :
==================
(Operation not yet implemented) When I use Crystal Reports 10 to Print Or Export
I am using vb.net asp.net and windows 2003 server .
thank you all
Nsr
|
|
|
|
|
I am trying to get used to with automated data ui generation tools in vs2005. I generated an input ui just by dragging detailed view of an table from data sources pane. It created binded sources and even a navigator for data source. everything is fine up to here but i just dont like the names of controls generated. is it possible to change naming style of these auto generated controls automatically?
for example: FirstNameTextBox -> txtFirstName
|
|
|
|
|
Nope, not as far as I know.
Some third party add on tools DO allow you some level of customization to the emitted code they create though, that's what makes them more attractive than using the 'free' stuff included in the IDE.
|
|
|
|
|
Hi i have a requirement in one project in vb.net 2005
There is employee master with reports to field and from this table i need to create a organization chart in VB.net
Is there any sort of example available or anyone can give me some guidance regarding the same.
Regards
Riyaz Zujer Patanwala
I.T.Programmer
Al Jaber Energy Services
P.O.Box 47467
Abu Dhabi
U.A.E.
|
|
|
|
|
Dundas has a charting library that would probably be the easiest way for you to achieve this task.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi everyone
Im using VB.Net 2003. I have a field in a datagrid "Total", how do i calculate the total and Display it in a label
|
|
|
|
|
I would suggest enumerating all rows of the datasource (datatable) and summing up each value from the target column.
It would look something like this:
(assuming there is a DataTable already created called DT
<pre>
Dim Total As Double = 0#
For Each R As DataRow In DT.Rows
Total += R(1) 'This line simply adds the value from Column 1 of the current row.
Next
Me.label1.Text = Total.ToString() 'Set the labels text property to display the total.
</pre>
If you have a strongly typed DataTable, you may have access to the Properies of each DataRow to use instead of getting the column data using the index of in the row. For example R.Price instead of R(1).
Hope that does the trick.
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
( President Ronald Reagan)
-- modified at 21:50 Monday 28th August, 2006
|
|
|
|
|
Catch ex As COMException
How can i clear my Exception ? ex.Clear ?
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
You don't have to clear the exception, you have caught it.
Exceptions doesn't work the same way as the Err object did. When there is an error an exception object is created, and the error state is contained within that object. There is no ever-present global object that you have to clear.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Everyone,
Appreciate if anyone can post the code equivalent of
iFileNum = FreeFile()
open FileFullPath For Input As #iFileNum
sFileContents = Input(LOF(iFileNum), #iFileNum)
Close(#iFileNum)
in VB.NET
Thanks,
K
|
|
|
|
|
I have no idea what most of this does ( what does FreeFile return ? What does it do ? ), but the System.IO namespace has File, Directory and Path classes with static methods to perform all sorts of file operations. VB2005 also has My.FileSystem as shortcuts to all sorts of stuff.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Do a file.open and then say ReadToEnd, then do a file.close.
Pablo
|
|
|
|
|
I'm looking for way to read delimited text file into a
dataset.
i read many articls but that does not help me on how to create the connection string and how to tell the connection that the fields are Separated by colons or any something else
any suggestions, please ??
Tamimi - Code
|
|
|
|
|
refer this site connectionstring.com
this will help u out
chandru
|
|
|
|
|
I have 3 class and build it to 3 dll file, when i build my project i need to join 3 dll file and 1 file exe, please help me, thanks
kevil
|
|
|
|
|
You cannot turn 3 dlls into an exe. If you're using Vb.NET, you can certainly import the dlls very easily and use them in yuor code, but you will still have dlls you need to ship with your exe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i need code to use throught my application (vb.net 2003) with sql server 2000 to make backup for data base every time i close application and another code to restore database when reinstall application (all that during application the user didn't use enteripse manger or query analayzer)
ma_refay
|
|
|
|
|
i create setup package for my application i used setup wizard projects in vb.net 2003 i need to add sql engine into my setup package and this setup run automatic during setup installation
ma_refay
|
|
|
|
|
i want to add first column of datagrid as checkedbox against every row of datagrid. then from the list i will select some checkboxes according to need.how i will implement this thing plz tell me any simple way.
reply soon.
|
|
|
|