|
foremorecoast1 wrote: objConn = New SqlConnection(dbPath)
What does dbPath contain? Perhaps it is incorrect?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
AWwwwwwwwwwwwwwwwww.
my bad. hehe it was pointing to wrong database. thanks
very much never thought about that.
cheers
robin
|
|
|
|
|
Hi All,
I have posted this like hundred times and i seem to get no response from any. i am again refining my question hope that makes clear.
I have a data repeater in my webpage. which basically queries 3 tables and combines and repeats accordingly. but what i have in one table is a statatistical data like
id estimated actual year
1 20 18 2003-2004
1 23 21 2003-2004
1 24 14 2005-2006
2 20 24 2003-2004
2 15 29 2003-2004
2 16 14 2004-2005
3
4
7
etc.
missing IDs are present in other TABLES just not in statistical table.
i need to create individual chart for id 1 for year 2003-2004 and year 2005-2006 and so on for id 2 and so forth.
i can create once chart based upon a single table but its like a quering a table and based upon parameter i need to create new dataset and bind it to some web chart control.
the data should be presented something like this in a repeater.
Head information related to ID 1 from table 1
sub head description related to ID 1 from table 2
a chart for ID 1 of year 2003-2004 and a chart for ID 1 of year 2005-2006
(if no data present dont display chart). please note year field is only a string.
so on for other IDs.
Please help how to achieve this or do you know any Software that does this so that i can simply purchase this software.
thanks
Robin
|
|
|
|
|
You were told, back on March 2nd, and beyond, how to do this.
Create a SELECT to return all the UNIQUE ID's in your table. Then, you have to load your data into a DataTable. Create a DataView to filter out the records for a specific ID, one for each ID you retrieve. Then, you create and bind your chart to the data in the DataVIEW, not the table. Repeat this for each ID...
Asking this question 8 more times will not change the answer.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I've got a problem with my custum datagridcolumnstyles. As soon as I sort on a column with a custom column style after I have selected a different row, the code redraws a label(which is the columnstyle in the attached code snippet) the size of the entire grid. Also when changing the readonly status of the datagrid the datagrid seems to "freeze". I am probably missing something, but I am not sure what. Any suggestions? The attached code is converted from C# to vb so there might be some error there.
Thanks
David
Public Class clDTRDataGridLabelColumn
Inherits DataGridColumnStyle
Private lb As New Label
' The isEditing field tracks whether or not the user is
' editing data with the hosted control.
Private isEditing As Boolean
Public Sub New()
lb.Visible = False
lb.Dock = DockStyle.Fill
Me.NullText = ""
'tb.Height = 27
End Sub
Protected Overrides Sub Abort(ByVal rowNum As Integer)
isEditing = False
RemoveHandler lb.TextChanged, _
AddressOf lbtextChanged
Invalidate()
End Sub
Protected Overrides Function Commit _
(ByVal dataSource As CurrencyManager, ByVal rowNum As Integer) _
As Boolean
lb.Bounds = Rectangle.Empty
AddHandler lb.TextChanged, _
AddressOf lbtextChanged
If Not isEditing Then
Return True
End If
isEditing = False
Invalidate()
Return True
End Function
Protected Overloads Overrides Sub Edit( _
ByVal [source] As CurrencyManager, _
ByVal rowNum As Integer, _
ByVal bounds As Rectangle, _
ByVal [readOnly] As Boolean, _
ByVal instantText As String, _
ByVal cellIsVisible As Boolean)
Dim value As String
If cellIsVisible Then
lb.Text = value
lb.Visible = True
AddHandler lb.TextChanged, _
AddressOf lbtextChanged
Else
lb.Text = value
lb.Visible = False
End If
If lb.Visible Then
DataGridTableStyle.DataGrid.Invalidate(bounds)
End If
End Sub
Protected Overrides Function GetPreferredSize( _
ByVal g As Graphics, _
ByVal value As Object) As Size
Return New Size(100, lb.PreferredHeight)
End Function
Protected Overrides Function GetMinimumHeight() As Integer
Return lb.PreferredHeight
End Function
Protected Overrides Function GetPreferredHeight(ByVal g As Graphics, ByVal value As Object) As Integer
Return lb.PreferredHeight
End Function
Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal bounds As Rectangle, ByVal [source] As CurrencyManager, ByVal rowNum As Integer)
Paint(g, bounds, [source], rowNum, False)
End Sub
Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal bounds As Rectangle, ByVal [source] As CurrencyManager, ByVal rowNum As Integer, ByVal alignToRight As Boolean)
Paint(g, bounds, [source], rowNum, Brushes.Red, Brushes.Blue, alignToRight)
End Sub
Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal bounds As Rectangle, ByVal [source] As CurrencyManager, ByVal rowNum As Integer, ByVal backBrush As Brush, ByVal foreBrush As Brush, ByVal alignToRight As Boolean)
Dim str As String
Dim rect As Rectangle = bounds
If Not GetColumnValueAtRow([source], rowNum) Is DBNull.Value Then
str = CType(GetColumnValueAtRow([source], rowNum), String)
Else
str = ""
End If
If rowNum = Me.DataGridTableStyle.DataGrid.CurrentRowIndex Then
backBrush = New SolidBrush(Me.DataGridTableStyle.SelectionBackColor)
End If
g.FillRectangle(backBrush, rect)
rect.Offset(0, 0)
g.DrawString(str, Me.DataGridTableStyle.DataGrid.Font, foreBrush, RectangleF.FromLTRB(rect.X, rect.Y, rect.Right, rect.Bottom))
Console.WriteLine(bounds.Width & " " & bounds.Height & " " & Me.HeaderText)
End Sub
Protected Overrides Sub SetDataGridInColumn(ByVal value As DataGrid)
MyBase.SetDataGridInColumn(value)
If Not (lb.Parent Is Nothing) Then
lb.Parent.Controls.Remove(lb)
End If
If Not (value Is Nothing) Then
value.Controls.Add(lb)
End If
End Sub
Private Sub lbtextChanged(ByVal sender As Object, ByVal e As EventArgs)
Me.isEditing = True
MyBase.ColumnStartedEditing(lb)
End Sub
End Class
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
I am creating a custom winform control that extends the TreeView control.
One property I am adding is a collection.
I have tried to follow some outlines of other controls that allow the editing of the collection at design-time and have those edits persist in your form.
Code to create my collection objects is being added to the form Initialize code. The collection item properties are being set correctly in this code also.
But, code is not being created that adds the collection item to the parent controls collection.
Can someone provide a quick, abbreviated checklist for things that must be done to be sure the designer creates all the code required in the form initialize block?
Thank You,
Any Takers On This Item??????
Rhorc
-- modified at 19:05 Thursday 9th March, 2006
|
|
|
|
|
I have a program that stores passwords and after logging in, I would like to close the main page and show the page that has the passwords. I can show the second page but I cannot get the main page. Can anyone help? Thanks.
|
|
|
|
|
I tested this in VB.Net 2005, but I don’t know if it works in VB.Net 2003
Here, you cannot close the form, but you can hide it like this
Dim frm2 As New frmSecondForm<br />
frm2.Show()<br />
Me.Hide()
For the second form
Me.Hide()<br />
Dim frm1 As New frmFirstForm<br />
frm1.Show()
If you like to disable the main form while you work with the second form. You can use
Dim frm2 As New frmSecondForm<br />
frm2.ShowDialog()
If you use VB.Net 2005
frmSecondForm.Show()<br />
Me.Hide()
For the second form
frmFirstForm.Show()<br />
Me.Hide()
If you like to disable the main form while you work with the second form. You can use
frmSecondForm.ShowDialog()
chatura
|
|
|
|
|
I need to design a simple program. There are two databases on seperate computers and they need to have the same data. I need to have the program keep each database up to date with each other. Any ideas? Thanks in advance.
|
|
|
|
|
Depends which database engine you are using, but I'd look at the native support built into most db's these days to provide this functionality without programming effort. (I'm talking about SQL Server, Oracle etc - not Access.)
You could use log shipping, transactional replication, or a number of other methods - all controlled by the db engine itself. You'll need to look at the db's doc to find out what sort it provides.
...Steve
quod erat demonstrandum
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Hi, I was wondering if anyone out there might be able to help me with the removal of the selectedindexchanged event from a custom combobox? I have created a custom combobox control and have the keyevents calling a method that will reset the selectedIndex changed event to 0, and then to -1. I do this because visual studio 2003 seems to have problems setting the combobox index to -1. In that method, I need to shut down the index changed event so that the event is activated only once when the index is changed, but I do not know how exactly I can remove the handler/disable the event within a custom control that inherits from the combobox. Anyhelp would be greatly appreciated. Thank you and have a nice day.
Code: -not working
'delegate declaration?
Shadows Event SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
'Handling event
Protected Overrides Sub OnSelectedIndexChanged(ByVal e As System.EventArgs)
MyBase.OnSelectedIndexChanged(e)
End Sub
'Reset Index
Public Sub resetIndex()
RemoveHandler SelectedIndexChanged, AddressOf OnSelectedIndexChanged
Me.SelectedIndex = 0
AddHandler SelectedIndexChanged, AddressOf OnSelectedIndexChanged
Me.SelectedIndex = -1
End Sub
eatwork
eatwork
|
|
|
|
|
I'm done with my browser and things are working very nicely, thanks to a lot of advice from the people here. My next project is a chat system but I'm not sure which approach would be best to take. I want to making the main application, that will nest all these other projects of mine (Browser, chat, ect), as peer-to-peer as possible in order to avoid as much server usage. I know that it will be unavoidable in certain cases but it is my ultimate goal. I've seen many examples on this site on chat systems but I'm not quite sure as to which is best. Any suggestions as to which type of system/approach would be best for this chat project of mine?
Any thoughts would be greatly appreciated.
Thanx
-- modified at 19:46 Tuesday 7th March, 2006
|
|
|
|
|
Hello
Check the path of the file in the OLEDBConnection of your project.
-- modified at 11:59 Tuesday 7th March, 2006
|
|
|
|
|
Hi,
When I lookin under "My Project", Settings, the value for my db connection is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\dbSpringBook.mdb
Is this not correct for deployment, as the app should find where the .mdb file?
|
|
|
|
|
Ok
I don´t know what you mean by |DataDirectory|
but what you can try is:
Dim DatabasePath as string
DatabasePath=Application.StartupPath & "\dbSpringBook.mdb
"
Then
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabasePath
Put the database in the same path of your executable file.
Hope it helps
-- modified at 12:36 Tuesday 7th March, 2006
|
|
|
|
|
Hi,
I have included the database file in the same path as my executeable, but when I run the Publish Wizard in visual studio, and then execute the setup wizard on another computer, it still cannot find the database file.
Any other suggestions?
|
|
|
|
|
Hello
Can you specify the error that the application is giving you?
|
|
|
|
|
Sure,
When I go to run the Published Install from another computer, I get the following error:
Could not find file 'C:\Documents and Settings\Rashar\Local Settings\Apps\2.0\Data\GHJ14R6W\Data\dbItems.mdb'
*********** Exception Tet *****************
System.Data.OleDb.OleDbException: Could not find File 'C:Documents and Settings\...dbItems.mdb
at System.Data.OleDb.OleDbConnectionInternal.ctor(OleDbConnectionString)
...
So if i hit continue on the error, the app will load up fine, but I do not see any data.
Under "My Project" in the Publish Tab, I have clicked on the Application Files button and ensured that my database is included in the publish.
|
|
|
|
|
Hi,
I actually figured it out. I removed the database from my project, then readded it, and then selected the option Yes to copy database to project.
Thanks for your help.
Rashar
|
|
|
|
|
Hi all!
i m using AxWebBrowser in vb.net application by dragging it to the form its working fine, but i want to use it with out form's support i,e; programatically.i am doing like this
''''''''''''''''''''''
Private WithEvents mybrowser As AxSHDocVw.AxWebBrowser
mybrowser = New AxSHDocVw.AxWebBrowser
mybrowser.Navigate("www.google.com")'Exception in this line
'''''''''''''''''''''''''''''''
Exception is "Invalid ActiveXState"
Any help thanks!
Abu Sufyan
|
|
|
|
|
IIRC, the control will only work when it's on a form. You can't use it without one. There's nothing preventing you from putting it on a hidden form though...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
You just beat me to it. lol Abu this is one of the very generous people that helped me with mine, I'd listen to him.
|
|
|
|
|
Hi Abu,
The problem I see is that you are not adding the AxWebBrowser control to anything first before trying to use it. As far as I know you have to add it to a form, TabPage, Panel or GroupdBox or something like that. You can't just tell it to appear and start using it, it must be put on something of that nature first in order to use it. But I could be wrong, I'm new at this although I just finished working with the AxWebBrowser control to do a Web Browser myself.
|
|
|
|
|
Hi
Is there a quick n easy way to create an app that has a text box on the left where you can type in HTML, and a 'Web Browser' box on the right that can display the HTML from the text box?
Thanx
Richard
-- modified at 9:06 Wednesday 8th March, 2006
|
|
|
|
|
lol is that hard?
i am doing on that...
i am working html editor... just like dreamweaver
yust place one textbox and one axwebbrowser
thats all
in textbox you type code, and when u click on button preview then the webb.visible=true
webb.enabled=true
-------------------------------------------
for saving and opening (streamreader, streamwriter)
-------------------------------------------
u need to save project and then the webb.navigate(saved path)
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|