|
Hi guys.I am Daniel from Ethiopia. I am new to this site.I developed a DBMS using VB 6.0 for some agency and when i try to install the setup program for this application, i get the following error message:
" Cannot start main setup program ( Create proces returned error code 0 x 000000C1H) "
Can any one tell me what might have caused this problem?
And before installing the setup program for the application i have developed, i formatted the PC because i tried the same set up program to install it before i formatted the PC and it worked.The only problem back then was that after it was successfully installed,, when i tried to login in to the program( becuase it has a login form), it displayed,
" Disk or Network Error"
I would relly appreciate if any body would help me out.
ASAP.
The freak dude is out! "
|
|
|
|
|
Hi Daniel,
I think it might be a good idea to first try and install your application on an entirely different PC. It sounds a little like there might be a problem with your hardware. See if the same error is thrown on another machine.
If that proves the bug is in the code after all, you could install the VB6 development environment on the target pc and run your code using the debugger, to see where the error happens.
Good luck,
Johan
|
|
|
|
|
Hi
If you use:
DataAdapter.FillSchema(dtTable, SchemaType.Source)
DataAdapter.Fill(dtTable)
... Add records to dtTable
DataAdapter.Update(dtTable)
Do ONLY the modified records get written back to the database, or will this command copy ALL the records back? (Basically what I am asking is: Is there any chance or "Wrecking" the original records that were in the database, or is it only the rows added that will be inserted)
Regards
Richard
|
|
|
|
|
If I'm not mistaken, you should be able to print out the .UpdateCommand property of the DataAdapter.
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
HI
How do I do this? I tried: MessageBox.Show(da.UpdateCommand.CommandText) but get an "Object Reference not set to an instance of an object" exception.
|
|
|
|
|
Post the block of code you are referring to. Make sure "da" is the name of your DataAdapter, as well as all of your other objects having the proper name.
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
Hi
Here is the code. there is a bit of redumndant code where I tried other methods of adding the data...
Dim drTmplt As DataRow = Me.dtStockmSample.Rows(0) 'I Use this row as a template for all ne rows
Dim drNewRow As DataRow ' This is the row to be added
Dim drXLRow As DataRow 'Row that contains new values imported from Excel
Dim cnStr As String = "Server='" & Me.txtServer.Text & "';Database='" & Me.txtDatabase.Text & "';uid='userid';pwd='pwd'"
Dim cn As New SqlClient.SqlConnection(cnStr)
Dim da As New SqlClient.SqlDataAdapter("SELECT * FROM " & Me.txtDatabase.Text & ".scheme.stockm", cn)
Dim i As Integer
dtStockm.Rows.Clear()
Try
cn.Open()
da.FillSchema(dtStockm, SchemaType.Source)
da.Fill(Me.dtStockm)
da.SelectCommand.CommandText = "SELECT * FROM " & Me.txtDatabase.Text & ".scheme.stockm"
Dim cb As New SqlClient.SqlCommandBuilder(da)
cb.GetInsertCommand(True)
For i = 0 To Me.dtXlData.Rows.Count - 1
drXLRow = Me.dtXlData.Rows(i)
drNewRow = dtStockm.NewRow
drNewRow.Item(0).GetType.Name.ToString()
For j As Integer = 0 To Me.dtStockmSample.Columns.Count - 1
drNewRow.Item(j) = drTmplt.Item(j)
Next
drNewRow.Item("warehouse") = drXLRow.Item("warehouse")
drNewRow.Item("product") = drXLRow.Item("product")
drNewRow.Item("alpha") = drXLRow.Item("alpha")
drNewRow.Item("description") = drXLRow.Item("description")
drNewRow.Item("unit_code") = drXLRow.Item("unit_code")
drNewRow.Item("long_description") = drXLRow.Item("long_description")
drNewRow.Item("nominal_key") = drXLRow.Item("nominal_key")
drNewRow.Item("purchase_key") = drXLRow.Item("purchase_key")
drNewRow.Item("analysis_a") = drXLRow.Item("analysis_a")
drNewRow.Item("qty_decimal_places") = drXLRow.Item("qty_decimal_places")
drNewRow.Item("batch_traceability") = drXLRow.Item("batch_traceability")
drNewRow.Item("standard_cost") = drXLRow.Item("standard_cost")
drNewRow.Item("lead_time") = drXLRow.Item("lead_time")
drNewRow.Item("standard_labour") = drXLRow.Item("standard_labour")
drNewRow.Item("standard_overhead") = drXLRow.Item("standard_overhead")
drNewRow.Item("standard_material") = drXLRow.Item("standard_material")
drNewRow.Item("reorder_days") = drXLRow.Item("reorder_days")
drNewRow.Item("stock_take_toleran") = drXLRow.Item("stock_take_toleran")
drNewRow.Item("analysis_x_ref") = drXLRow.Item("analysis_x_ref")
Me.dtStockm.Rows.Add(drNewRow)
Next
'*********** NEXT LINE GIVE EXCEPTION ****************
'MessageBox.Show(da.UpdateCommand.CommandText)
da.Update(dtStockm)
'Dim rowsupdate As Integer = da.InsertCommand.ExecuteNonQuery()
MessageBox.Show(Me.dtXlData.Rows.Count.ToString & " Rows Imported Successfully")
Catch ex As Exception
MessageBox.Show("The following Error Occured in ROW '" & i & "' of the import. " & ControlChars.NewLine _
& "Error: " & ex.Message)
Finally
cn.Close()
End Try
|
|
|
|
|
Is there any way that you can tell the difference between an exe compiled in VB6 and an exe compiled in VB.Net. If not, can anyone recommend or tell me how this can be done.
Thanks in advance.
|
|
|
|
|
IS_Assessor wrote: Is there any way that you can tell the difference between an exe compiled in VB6 and an exe compiled in VB.Net.
A Windows EXE file uses the PE format[^]. It should be possible to determine what kind of code it contains by examining the headers.
IS_Assessor wrote: If not, can anyone recommend or tell me how this can be done.
If there was no way to do it, how could anyone tell you how it could be done?
---
b { font-weight: normal; }
|
|
|
|
|
Well, you could try to run it on a machine that doesn't have the framework... Or, just run it and see if it looks clunky or not :P
A .NET app, I am pretty sure, has a special header. So, you can probably tell by examining it in a hex editor. But, I don't know the details off the top of my head.
Christian Graus - C++ MVP
|
|
|
|
|
Hi
I'm using DataAdapter.FillSchema(dtTable, SchemaType.Source) from a SQL Sever.
1) Does this set the Columns(n).Datatype properties?
2) If so, does it set the datatype to a vb.Net Datatype, or is it an SQL datatype. (E.g. if the SQL source column was CHAR 3, it seems simply to set the type to a string)
3) If you use that same column in a DataAdapter.Update(dtTable) what datatype is written back to that database? (Does the DataAdapter present the application with a VB TYpe, and then when writing back to the SQL database, presesnt the Database with an SQL datatype?)
tks
Richard
|
|
|
|
|
good Q!
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
|
HI
From reading the link, it seems the data is not actually cast to any datatype, it is only constraints, allow dbnulls etc that is set with fillschema.
If a database datatype is for example char 3, and you use the upadte method of the dataadapter with any string, as long as it's less than 3 chars long will that be ok? Then what about date? the dates are displayed as 00-01-1900 00:00:00, but that is normally a number, and it is only formatting that shows it in that format.
The other part I dont understand, if you pull data from the table, and then get the datatype for each colum of one of the rows, the columns of each row have definite datatypes (If dr is a row of dt and you go dr.Item(0).GetType.Name.ToString you get various datatypes for each column of the database, that sort of match the database datatype - i.e. double in db = double, char 3 in db = string, date 4 in db = datetime etc. How are these datatypes set in the table when you retrieve data via the DataAdapter?
|
|
|
|
|
Hi,
I have a combobox which binds to a table column named TestTypeId.
I have a seperate table (within the same dataset) named tblTestTypes(TestTypeId, TestDesc)
I want the dropdown list of the combobox to display the TestDesc, but the actual data saved to my original table must be TestTypeId.
In Access this was easy, the control source property specified what was saved, while the row source property specified what data is displayed in the dropdown list.
In .Net I haven't the faintest idea how to tackle this! I can only choose from one DataTable as the DataSource, the ValueMember and the DisplayMember!
Any help would help!
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
The data binding of a combobox only serves to populate the dropdown list. To save the data you have to write some code.
---
b { font-weight: normal; }
|
|
|
|
|
Nooooooooooooooooooooooooooooooooooooo!!!
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
Don't you just hate it when coding actually involves writing code...
---
b { font-weight: normal; }
|
|
|
|
|
I prefer writing code, but it yanks my chain when a new version of a control has less functionality than the older ones! Writing code for this will require an extra SQL connection which will result in extra overhead!
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
It's not a new version of the same control, is a completely different control in a completely different environment. When you use a control in Access, you are actually inside the database application itself, that's why it can bind the control to a specific record. Now instead you are in a Windows application and are communicating with an external database.
---
b { font-weight: normal; }
|
|
|
|
|
Then they shouldn't have called it a ComboBox.
The one I used in Access linked to an external SQL Server, via the linked tables.
Why can't the one in .Net do the same via datasets?
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
evilnoodle wrote: Then they shouldn't have called it a ComboBox.
In that case the control in Access shouldn't be called a combobox either. A combobox is just the windows control that is used to select an item, it's just a graphical object, it has no database capabilities at all.
evilnoodle wrote: The one I used in Access linked to an external SQL Server, via the linked tables.
Why can't the one in .Net do the same via datasets?
Simply because it's not built that way. Usually a control doesn't update the database by itself, but a combination of several controls form the data that is going to update the datbase. Supposing that the data is meant to update the database at all, that is. That is far from always the case.
---
b { font-weight: normal; }
|
|
|
|
|
After hours and hours of trial and error (and with some help) I managed to do with the combobox what I thought (and read) was impossible. And it was afterall possible to do it without code.
Next up: Doing this with a combobox with multiple columns...
In MS Access all of the above (including the multi-column combobox) would take approx. 5 minutes to do.
I guess .Net teaches programming like Mr Miyagi teaches karate, through hardships, tough-love, and seemingly unnecessary repetitive tasks.
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
I wonder if someone could answer this question.
I am running VB.Net 2003 using .net framework 1.0. Will there be any problems installing .net framework 2.0. Will it make any difference.
|
|
|
|
|
No, both frameworks can sit side-by-side. You'll get an additional tab in IIS called ASP.NET because you'll have to tell IIS which version of the .NET Framework the web application is running in.
|
|
|
|