hi, how would I go about setting up a hashtable. I haven't worked with the hash Table yet. What I did try, what to see whether the table contained the a row with a field that matches the first cell in the datagrid. But it made my dataAdapter or something to stop working before the problem even hit that function. yet gave no errors at start-time.
Ideally, I’d like to have an ACCESS DataBase, containing data about the Foo1, Foo2 structures. So, I would be able to build a program, which uses this data base and (for instance) generates automatically the C code structure definitions above.
The questions I ask myself are:
1) How to organize data which is hierarchical by nature using a relational
data base such as ACCESS?
2) Are they better solutions than using ACCESS to solve this kind of
3) Do you know about other databases or commercial softwares that permit to
4)Could you please give me either a precise answer or links which can help me?
Have you ever used XML? It's great for storing hierarchical data and it's very similar to HTML, so if you've done any web design that will give you a head start. The .NET Framework has lots of built-in classes for dealing with XML files and data streams.
Official W3C XML site: http://www.w3.org/XML/
Microsoft's XML developer center: http://msdn.microsoft.com/xml/
I'm not the one to ask for help on this as I'm not too familiar with the details of how it all works, just a few general ideas, but it's just a thought...
Did youi read the Sql Server Books online. Open it and index on DBCC Shrinkdatabase
Got this samll bit, you should read more about it to get a full understanding
For log files, SQL Server uses target_percent to calculate the target size for the entire log; therefore, target_percent is the amount of free space in the log after the shrink operation. Target size for the entire log is then translated to target size for each log file. DBCC SHRINKDATABASE attempts to shrink each physical log file to its target size immediately. If no part of the logical log resides in the virtual logs beyond the log file's target size, the file is successfully truncated and DBCC SHRINKDATABASE completes with no messages. However, if part of the logical log resides in the virtual logs beyond the target size, SQL Server frees as much space as possible and then issues an informational message. The message tells you what actions you need to perform to move the logical log out of the virtual logs at the end of the file. After you perform the actions, you can then reissue the DBCC SHRINKDATABASE command to free the remaining space. For more information about shrinking transaction logs, see Shrinking the Transaction Log.
Because a log file can only be shrunk to a virtual log file boundary, it may not be possible to shrink a log file to a size smaller than the size of a virtual log file, even if it is not being used. For example, a database with a log file of 1 GB can have the log file shrunk to only 128 MB. For more information about truncation, see Truncating the Transaction Log. For more information about determining virtual log file sizes, see Virtual Log Files.
I am trying to build a recordset which pulls all the people from tbl_LATCH and builds a recordset that has a field [Count] which is the total number of children they have and another field [Ages]** which is the ages of the children. Also, included is the fields from tbl_Customer.
**[Ages] i.e. (4, 5, 12, 10) If there were four recordsets returned from the subquery or whatever then it would concat them into one field.
Any help would greatly be appreciated. Thanks in advance.
Hi Garrett. You may want to have a subquery take care of the [Count] and [Ages] fields, with a custom function to derive [Ages]. Start with a custom function to return an age given a birthdate. Here is a good function that comes from a Microsoft KB article:
Function Age(varBirthDate As Variant) As Integer
Dim varAge As Variant
If IsNull(varBirthDate) Then Age = 0: Exit Function
varAge = DateDiff("yyyy", varBirthDate, Now)
If Date < DateSerial(Year(Now), Month(varBirthDate), _
varAge = varAge - 1
Age = CInt(varAge)
Then create a function that takes a parent id (l_Mem_ID in your case) and returns a string of ages for each child. This can be done by executing a query on the fly and looping through the resulting recordset:
Function GetAgesOfChildren(parentID As Integer) As String
Dim sResult As String
Dim sSql As String
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set conn = Application.CurrentProject.Connection
Set rst = New ADODB.Recordset
'--select statement uses the Age() function
sSql = "Select Age(DOB) From tbl_Children Where l_Mem_ID = " _
& parentID & " Order By Age(DOB)"
'--open the recordset
rst.Open sSql, conn
sResult = ""'--loop through the recordset to create a concatentated string
While Not (rst.EOF)
If sResult <> "" Then sResult = sResult & ", "
sResult = sResult & CStr(rst(0))
GetAgesOfChildren = sResult
Set rst = Nothing
Set conn = Nothing
It won't be particularly effecient, but it will get the job done. Your subquery could then just link tbl_Customers to tbl_Children, use the Group By option with the Count() function for your [Count] field, then use the following as an expression for the third [Ages] field in the query grid:
Make the join between tbl_Customers and tbl_Children a left outer join and you'll get zero values for those customers without children records, rather than having those records drop off. Finally then, you can use this subquery in your main query with the tbl_LATCH table to get your final result set.
the data that I save in a database is automatically displayed on the datagrid. But if I use:
Set adocon = New ADODB.Connection
Set adorset = New ADODB.Recordset
adocon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "dbnames.mdb"
adorset.Open "Table2", adocon, adOpenKeyset, adLockOptimistic
wherein the problem is that it overwrites the first record on a datagrid and once I unload and reload, that's the only time that the new record would be placed at the end.
I can't use the movenext and moveprevious properly as well whenever I use this type of setup.
We developed a CS program by C#,the server is SQL Server,i copyed the program to a system without SQL Server,the program can not be run,the error report is something like this:"Can't connect to Database".when i installed the "Connectivity Only" option of SQL Server,the program can be run in this system.
what i want to know is how to run our program without install anything of SQL Server, or just copy something usefull to the system from SQL Server.
Seems like you are pointing towards the local machine in your code. Obviously if there is no SQL server on the machine it can't connect.
Itz advisable that you keep the connection string configurable and change the connection string in the configuration and make it point towards a machine where you have SQL Server.
remember .NET requires MDAC 2.5 and above to connect to any database...
OK, look at the Server name. Do you have the proper ODBC/Client Utility settings that allow you to access that data server. Test your connections. If you want to connect to Sql server you will need something to access it. You can not just say go talk to this server you need to have connectivity thru software like ODBC/Sql server Client Utility.
As command builder is used to generate the sql statements so it works well with columns names with no spaces like [FirstName], but if we make it
[First Name] then it throws following exception:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
Can anybody give me the idea that how to reslove this, i dont want to remove spaces because they coulmn names are displayed at run time on form so that if i change the name in table, it get changed on form automatically.
I have a problem in SQL 2000. I have a table call Employee in that there r many details of employee such as his name his age and other details.
I want to insert one employee name D'souza mike for that i write a query
insert into employee values ('D'Souza Mike', 21)
Here name is D'Souza so that special character ' create problem while executeing query.
any one know how to insert special characters like ' _ % then please tell me
You can't directly insert any special character.Just decode your special character with any other name e.g. "'" you can give your single quote the name "SQT".Now insert this value in the database.Now when you retrieve the value then decode this "SQT" to "'".That's all..... your job has done.
Either escape the ' with another ' ('') or use an SqlCommand object with parameters. You can set the value of the parameter to a string containing 'special characters' and it will insert without difficulty.
Power corrupts and PowerPoint corrupts absolutely. - Vint Cerf