|
JonCox wrote: Hi am quite new to programing and would like to know if you can creat a stand alone Data base using tables without the use of SQL and without attaching the front end to an Access table.
You can use a database that doesn't use SQL. Although I'm not sure what you'd achieve by that. Why do you not want to use SQL? (It is the standard language for writing queries)
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Hi there thanks for your reply.
Sorry i was refuring to SQL server. However, my ignorance is apparent, as I do not understand how i would call or instruct an application to use SQL. Also is it a component of visual studio?
Thank you for your time.
|
|
|
|
|
Theres nothing built in that will act as a database for you. You could make something similar using an XML file or some other file based storage, but if your new to programming that might not be the best place to start
The other alternative is using an external database. Do you want something that is small and file based (best suited for when just one app wants a database) or something bigger and memory based (that can handle alot of connections over a network)?
When you say wihtout the use of SQL do you mean the SQL language or Microsoft Sql Server?
If you don't want to use Access then don't :P theres plenty of other solutions out there,
If you want a memory based solution I'd recommend Microsoft Sql Server 2005 Express[^] sinces it's got the great price of free It's a solid product with alot of features.
If you want something file based I'd recommend SqLite[^]. It's small, fast and free but it'll take some effort to setup for use.
|
|
|
|
|
Thank you for your reply.
The program i am trying to creat is an update of an app that uses RAF files to store and access the data. However this has proven to be slow and resource heavy. I would like to be able to rewrite the app using a data table to see the speed difference and hopfully improve the programs response time. The problem was that i ended up creating four RAF files that where all being cross refrenced.
I was hopeing to creat a app that can use relationships.....however i failed miserably lol
Thanks once again for your reply and i will look into it a bit further.
|
|
|
|
|
Hi,
You can build a dataset/tables on the fly and saving it as XML.
'--Create DataSet (Database)
Dim DS as new dataset
ds.Tables.Add("Table1")
ds.Tables(0).Columns.Add("ID", System.Type.GetType("System.Int32"))
ds.Tables(0).Columns.Add("Col1", System.Type.GetType("System.String"))
'-- Add Data
Dim dr As DataRow
dr = ds.Tables(0).NewRow
dr.Item("ID") = 1
dr.Item("Col1") = "BMW"
ds.Tables(0).Rows.Add(dr)
'-- Check the added data
For Each tmpdr As DataRow In ds.Tables(0).Rows
MsgBox(tmpdr.Item(1))
Next
'-- save data
ds.WriteXml("c:\mydata.xml")
Hope this helps
|
|
|
|
|
Hi there thank you very much that is exactly what i needed.
|
|
|
|
|
hello,
the questions in the title.
how would I do this. The reason is I am using a panel which has a gradient color scheme and I want to drop the property grid on the panel. But I dont want to ruin the gradient effect.
Any Ideas??
thanks
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
You can't do this without making your own PropertyGrid control and ownerdrawing the whole grid. The BackColor property of the PropertyGrid doesn't support Transparent.
|
|
|
|
|
thanks for that dave,
speaking as a person who has never ever used VB's drawing commands
and as someone who had a play at the weekend and got nowhere -
how would I do that?
any tips, ideas, code???
thanks
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
You start with creating your own PropertyGrid class, inheriting from the existing class.
Public Class MyPropertyGrid
Inherits PropertyGrid
.
.
.
Then you override the OnPaint and/or OnPaintBackground methods and supply your own drawing code to draw everything you need.
If you haven't used the drawing methods, or even have a basic understanding of how painting works, you're going to find this a frustrating process. Google for "vb.net drawing" for lots of examples and articles.
|
|
|
|
|
hi,
I have tried
Public Class myProp
Inherits PropertyGrid
Protected Overrides Sub OnPaintBackground(ByVal pevent As PaintEventArgs)
MyBase.OnPaintBackground(pevent)
Dim g As Graphics = pevent.Graphics
Dim gradBrush As System.Drawing.Drawing2D.LinearGradientBrush
gradBrush = New System.Drawing.Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(Me.Width, Me.Height), Color.Green, Color.Blue)
' g.FillRectangle(gradBrush, 0, 0, Me.Width, Me.Height)
g.FillRectangle(gradBrush, pevent.ClipRectangle)
End Sub
Protected Overrides Sub OnPaint(ByVal pevent As PaintEventArgs)
MyBase.OnPaint(pevent)
Dim g As Graphics = pevent.Graphics
Dim gradBrush As System.Drawing.Drawing2D.LinearGradientBrush
gradBrush = New System.Drawing.Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(Me.Width, Me.Height), Color.Green, Color.Blue)
' g.FillRectangle(gradBrush, 0, 0, Me.Width, Me.Height)
g.FillRectangle(gradBrush, pevent.ClipRectangle)
End Sub
but these dont seem to cover the area where the "view back color" paints. In actual fact they seem to paint on only one or two lines between the text time and the outer rim of the cocontroller area.
thanks
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
MartyK2007 wrote: Protected Overrides Sub OnPaintBackground(ByVal pevent As PaintEventArgs)
MyBase.OnPaintBackground(pevent)
Dim g As Graphics = pevent.Graphics
Dim gradBrush As System.Drawing.Drawing2D.LinearGradientBrush
gradBrush = New System.Drawing.Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(Me.Width, Me.Height), Color.Green, Color.Blue)
' g.FillRectangle(gradBrush, 0, 0, Me.Width, Me.Height)
g.FillRectangle(gradBrush, pevent.ClipRectangle)
End Sub
First, you don't create your own Graphics object. You'll find it in the PaintEventArgs that you're getting when your code is called.
Dim g As Graphics = pevent.Graphics
Your next mistake is that if you want to REPLACE the background functionality, you don't call the base classes OnPaintBackground method. That will paint the background of the control just like you didn't even attempt to make your own version of it.
Third, the Graphics objects to DID create, you didn't Dispose of. This will, most assuredly, run your machine out of resources and your app will eventully crash with an OutOfMemoryException. On top of that, if you didn't create the object, like Graphics, you do NOT Dispose of it.
|
|
|
|
|
hey,
this was just sample code and not clean in any way.
Dave Kreskowiak wrote: Dim g As Graphics = pevent.Graphics
er if you look at the snippet - thats exactly what I do
MyBase.OnPaintBackground(pevent)
Dim g As Graphics = pevent.Graphics
Dave Kreskowiak wrote: REPLACE the background functionality
dont really want to replace them as overwrite on top of them thats why I ran this first.
Interestingly enough if I dont run the base classes then I get the same result.
Dave Kreskowiak wrote: Third, the Graphics objects to DID create, you didn't Dispose of
absolutely - this is a proof of concept , rather that a clean solution. Of course I will dispose of them properly when the solution happens.
My problem is that my color gradient only appears behind the propertygrid ( its its view back color area).Effectively this means a couple of lines at the top of the pG and a couple between the description block and the rest of the PG.
Try it and see what I mean.
I need to change the color of the view back color area to a gradient which is the bit where there is no properties left to display on the PG. Pick a class then use the category view and minimise ecah category - the coloured background at the bottom is what I am after.
thanks
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
MartyK2007 wrote: er if you look at the snippet - thats exactly what I do
MyBase.OnPaintBackground(pevent)
Dim g As Graphics = pevent.Graphics
My bad! I misread your code! :->
MartyK2007 wrote: dont really want to replace them as overwrite on top of them thats why I ran this first.
Interestingly enough if I dont run the base classes then I get the same result.
In order to get a transparent background, you have to replace the background drawing code. That's what your original post said you wanted.
MartyK2007 wrote: My problem is that my color gradient only appears behind the propertygrid ( its its view back color area).Effectively this means a couple of lines at the top of the pG and a couple between the description block and the rest of the PG.
This would mean that the background of each "cell" in the PG is painted by the foreground OnPaint method. You would have to replace the standard OnPaint drawing code with your own. This means that you have to paint the entire control yourself! Is it worth it?
|
|
|
|
|
Dave Kreskowiak wrote: replace the standard OnPaint drawing code with your own
hi,
I have added this to the properties grid onpaint event
Protected Overrides Sub OnPaint(ByVal pevent As PaintEventArgs)<br />
' MyBase.OnPaint(pevent)<br />
Dim g As Graphics = pevent.Graphics<br />
Dim gradBrush As System.Drawing.Drawing2D.LinearGradientBrush<br />
gradBrush = New System.Drawing.Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(Me.Width, Me.Height), Color.Green, Color.Blue)<br />
' g.FillRectangle(gradBrush, 0, 0, Me.Width, Me.Height)<br />
g.FillRectangle(gradBrush, pevent.ClipRectangle)<br />
<br />
End Sub
and I expected the control contents to vanish and be replaced with a gradient colour but nothing happened.
does this mean each cell has its own onpaint function??
if so how do I find them ???
Dave Kreskowiak wrote: Is it worth it?
yes if I can - I am trying to have a consistant look n feel in my gui app.
of course scroll bars seem to be a problem because I cant find where to cheange them either.
so yes any help would be appreciated
Martin
thanks
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
Hi, everyone!
Is there any way to use UNCs inside connection strings while using a standalone development PC?
I'm creating a database app using VB2005 and an Access MDB file. I'm currently using DRIVE:\Directory\File.mdb in my ConnectionString, but I'd like to use the \\Server\file.mdb option or even the PC's IP address (is this possible as well?).
In my Windows XP system, My Network Places won't show the shared files in my local PC unless I network it with another PC. Before, in older systems like Windows 98 and Windows 2000, even when the PC was not connected to another PC, the shared files could still be viewed in My Network Places and Network Neighborhood. Does anyone here know how to display the local shared files in Windows XP's My Network Places without having to have the PC connected to a network?
|
|
|
|
|
NekoGato wrote: Is there any way to use UNCs inside connection strings while using a standalone development PC?
It depends on the database you are connecting to. Some may allow it, others won't.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
is there a way to exceed the Richtextbox MaxLength of "2147483647"?,
may be there is a way to make it unlimited pls help.
|
|
|
|
|
You need to display more that 2 gigabytes of rich text at once!?! I think it sounds like you need to restructure other parts of your application rather than find ways around the very generous limitations in user interface controls.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
i agree with colin. but if you really want to do that... i think there's no way to extend the maxlength for richtextbox. instead make use of a label as what i know there's no specific maxlength for that.
|
|
|
|
|
hi All,
I m trying to connect crystal report to database(Access) but i have no idea plz give me code or any logic syntax.
thanks in advance.
Nikesh Yadav
CSS Infotech
Gurgaon,
Haryana(India).
|
|
|
|
|
hi,
use following code
Try<br />
Dim obj As report1 = New report1 'here report1 is Crystal Report<br />
Dim ds As New DataSet<br />
Dim da As OleDbDataAdapter<br />
Dim str As String<br />
str = "SELECT * from TableName"<br />
da = New OleDbDataAdapter(str, conn) 'here conn is connection object<br />
da.Fill(ds)<br />
<br />
<br />
obj.SetDataSource(ds.Tables(0))<br />
CrystalReportViewer1.ReportSource = obj<br />
Me.Show()<br />
Catch ex As Exception<br />
MsgBox(ex.Message, MsgBoxStyle.Information, "Report")<br />
End Try
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
i know this will works defintely. thanks for you help
but tell me one more thing you will write is code on which form i.e. on the form which contains crystal report viewer or on the crystalreport.cs Plz clear it.
|
|
|
|
|
hi,
code which i provide is for form which contain CrystalReportViewer.However you can write these code on any form(after some modification)
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
|