|
Hi,
I am also an Electrical Engineer Working as a Programmer.
The task what you said is very easy for telling but it is very difficult for Implimentation. Because as you told it looks like simulation software we need to define each and every block with some sort of Default Data and we need to define some properties to that so that it will act as a block for us for simulations.
i am very happy to see a guy like me and i am also trying to some sort of simulations but i dont have a clear idea of what to do. As you have that idea i think i can help you if you need any help.
And as per my Knowledge this needs Extensive Research and Highly Responsive Algorithm.
Feel free to ask me any thing in this context.
|
|
|
|
|
I don't know why it is so difficult for me to connect to the MySQL database. But I have made a little progress. Data is being inserted to the db but the column names are being inserted instead of the values. Also after the program run for a while I will get the following error:
Can't connect to MySql Server(10048).
Here is some code to go by:
Dim myConnString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=192.168.1.27;" & _
"DATABASE=;" & _
"USER=;" & _
"PASSWORD=;" & _
"OPTION=3;"
Dim MyConnection As New Odbc.OdbcConnection(myConnString)
MyConnection.Open()
Dim MyCommand As New Odbc.OdbcCommand
MyCommand.Connection = MyConnection
MyCommand.CommandText = "INSERT INTO ls_orderitems (OrderItemID, OrderDate, OrderCustomer, OrderAcctNum, OrderType, OrderSoNum, OrderItemPartNum, OrderItemPartDesc, OrderItemQty, OrderItemQtyRec, OrderItemQtyDtRec, OrderItemBO, OrderItemBODt,OrderItemCanceled, OrderItemCanceledDt, OrderItemNotes, OrderItemPONum, OrderItemRetailPrice, OrderItemSalePrice, Status, InsertDate) VALUES('OrderItemID', 'OrderDate', 'OrderCustomer', 'OrderAcctNum', 'OrderType', 'OrderSoNum', 'OrderItemPartNum', 'OrderItemPartDesc', 'OrderItemQty', 'OrderItemQtyRec', 'OrderItemQtyDtRec', 'OrderItemBO', 'OrderItemBODt','OrderItemCanceled', 'OrderItemCanceledDt', 'OrderItemNotes', 'OrderItemPONum', 'OrderItemRetailPrice', 'OrderItemSalePrice', 'Status', 'InsertDate')"
MyCommand.ExecuteNonQuery()
MyConnection.Close()
jds1207
jds1207
|
|
|
|
|
jds1207 wrote: MyCommand.CommandText = "INSERT INTO ls_orderitems (OrderItemID, OrderDate, OrderCustomer, OrderAcctNum, OrderType, OrderSoNum, OrderItemPartNum, OrderItemPartDesc, OrderItemQty, OrderItemQtyRec, OrderItemQtyDtRec, OrderItemBO, OrderItemBODt,OrderItemCanceled, OrderItemCanceledDt, OrderItemNotes, OrderItemPONum, OrderItemRetailPrice, OrderItemSalePrice, Status, InsertDate) VALUES('OrderItemID', 'OrderDate', 'OrderCustomer', 'OrderAcctNum', 'OrderType', 'OrderSoNum', 'OrderItemPartNum', 'OrderItemPartDesc', 'OrderItemQty', 'OrderItemQtyRec', 'OrderItemQtyDtRec', 'OrderItemBO', 'OrderItemBODt','OrderItemCanceled', 'OrderItemCanceledDt', 'OrderItemNotes', 'OrderItemPONum', 'OrderItemRetailPrice', 'OrderItemSalePrice', 'Status', 'InsertDate')"
jds1207 wrote: Data is being inserted to the db but the column names are being inserted instead of the values.
Did you happen to look at what's in the VALUES clause?? It's inserting the Column names because that exactly what your telling it to do! VALUES ('OrderItemID', 'OrderDate', ... You've told it to insert these strings into the database. You have to build the SQL statement to insert the data you have stored in variables somewhere, preferrably using a parameterized query.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What about the error message? Do you have any ideas?
|
|
|
|
|
You didn't supply a database name in your connection string. You left the DATABASE option blank. You have supply the name of the database you want the connection to work with.
Dim myConnString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=192.168.1.27;" & _
"DATABASE=????????????;" & _
"USER=;" & _
"PASSWORD=;" & _
"OPTION=3;"
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The database name is in the original code. I just did not post the names.
|
|
|
|
|
It could the IP is wrong, the MySQL server isn't running, the user ID and/or password is wrong, ...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
In the Project Explorer window in VB 6.0, some of the icons for my forms are partially greyed out. The blank page part and the read-only lock part are okay, but the window with the aqua strip is greyed out. Does anyone know what this means? Thanks.
A long way from home
|
|
|
|
|
Sir/madam,
I am facing problem in the following line which is bold.I want to know the meaning of this line.It is associated with the following function.
<browsable(true), defaultvalue(false)=""> Public Property [ReadOnly]() As Boolean
Get
Return _ReadOnly
End Get
Set(ByVal Value As Boolean)
_ReadOnly = Value
End Set
end sub
Thanks and Regards
Pankaj
|
|
|
|
|
Which line? There isn't a line that's bold...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
As already mentioned there is no line in bold, but looking at the code you have supplied there seems to be an end sub that is in error/not required.
My guess at this point in time is to delete the end sub at the bottom of your ReadOnly property.
Regards,
Martin
|
|
|
|
|
The end sub should be End Property.
Kevin
|
|
|
|
|
How to read xml from a string object.
Reading XML from XML file is fine.
but how to read XML from a string, at that time there was error
|
|
|
|
|
Its hard to give an example without knowing what the XML data is, that said, below is an example that will create an x-path navigator for XML data taken from a string variable:
Dim sReader As New IO.StringReader(My_XML_Text_string)
Dim xDoc As New Xml.XPath.XPathDocument(sReader)
Dim xNav As Xml.XPath.XPathNavigator = xDoc.CreateNavigator()
The variable My_XML_Text_string contains your XML data....
At this point you can navigate through the XML nodes and attributes using the xNav instance
Regards,
Martin
|
|
|
|
|
Way is fine but Error I am receiving is same,
Same in case of XmlDocument.
Error "Root Element is missing"
|
|
|
|
|
It would seem there is a problem with your XML data and not your programming. The Root Node from your XML data is missing -- what is your XML data??
Martin
|
|
|
|
|
hi, i have a windows application. in load event of my form i retrieve data from " Microsoft Access" database.
when i build or run form,i see several Error MessageBox with this content : "object reference not set to an instance of an object ".
after that i submit these,Program Runs Successfully!!
what is my problem?
thanks
|
|
|
|
|
Your main problem appears to be that you can't decide what account to post with, or what language you're using. Or did a different user just happen to post the exact same question in the C# forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Dear Christian Graus
I am programmer with both C# and VB
It happened many times ,i Asked my problem in both C# and VB forums and i accept my answer in only one of theme.
Thanks
|
|
|
|
|
That message means you tried to set a property or call a method on a class that wasn't instantiated. The most common cause is that you assumed you'd get back an object from some kind of query, but instead, you got back Nothing and tried to use it or make some modification to it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you MR Dave Kreskowiak
|
|
|
|
|
Hi,
I have created 2 simple projects, one executable and one dll. The exe has a reference to the dll.
When I try to compile the dll (TEST TWO.vbproj) from a batch file the exe (TEST ONE.vbproj) is compiled also. Why does this happen? I thought I would have to issue another command to build the exe.
The batch file I use looks like
<br />
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0" /v InstallDir') DO SET InstallDir=%%B<br />
<br />
set mycommand="%InstallDir%devenv" /build Release /out "C:\BuildErrors.log" ".\TEST TWO\TEST TWO.vbproj"<br />
echo %mycommand%<br />
<br />
@call %mycommand%<br />
<br />
pause<br />
If anyone can suggest a nicer way of finding out the Visual Studio installation path I'd be very grateful.
Thanks very much,
dlarkin77
|
|
|
|
|
Have you considered using MSBUILD instead of using the Visual Studio environment? As I understand it, visual studio just uses MSBUILD underneath the covers anyway.
It can be accessed from the following path:
%windir%\Microsoft.NET\Framework\v2.0.50727
|
|
|
|
|
Thanks for that info Colin. I started looking at MSBuild but I got totally sidetracked with NAnt.
I've been playing around with it and it looks pretty good. But whenever I try to build a Windows Forms application the XP Visual Styles are being lost. Can anyone tell me what I need to do to keep the xp styles?
The build file I use is below:
<code>
<?xml version="1.0" encoding="Windows-1252" ?>
<project name="TESTER" default="run" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<property name="basename" value="TESTER"/>
<property name="debug" value="true"/>
<property name="build.dir" value="bin"/>
<namespaceimports id="tester.imports">
<import namespace="Microsoft.VisualBasic" />
<import namespace="System" />
<import namespace="System.Collections" />
<import namespace="System.Data" />
<import namespace="System.Diagnostics" />
<import namespace="System.Drawing" />
<import namespace="System.Windows.Forms" />
</namespaceimports>
<target name="build">
<mkdir dir="${build.dir}"/>
<vbc target="winexe" output="${build.dir}/${basename}.exe" debug="${debug}"
main="TESTER.frmMain"
optioncompare="text"
optionexplicit="true"
optionstrict="true"
rootnamespace="TESTER"
removeintchecks="true">
<imports refid="tester.imports" />
<sources>
<include name="*.vb" />
</sources>
<references>
<include name="System.dll" />
<include name="System.Data.dll" />
<include name="System.Drawing.dll" />
<include name="System.Windows.Forms.dll" />
<include name="System.Xml.dll" />
</references>
</vbc>
</target>
<target name="run" depends="build">
<exec program="${basename}.exe" basedir="${build.dir}" />
</target>
</project>
</code>
Thanks very much,
dlarkin77
|
|
|
|
|
What is the simplest way to update or add data with a DataSet?
My Dataset contains various tables with relations, I want a way to update my datasource according to all the changes that has taken place on my dataset (changes made by means of data-bound controls).
As far as I now System.Data.DataSet.AcceptChanges() does this, updating both the DataTables' and the DataRows' data to the datasource.
My problem is that when I add a control (eg. TextBox) to my form and setup it's DataBinding, it doesn't seem to communicate with the DataSet, so when I type something in that field and execute AcceptChanges() it doesn't update my datasource.
The control's databinding is setup to a BindingSource which has my dataSet as Source.
What does work is to do a BindingSource.EndEdit() for a specific DataTable and then a TableAdapter.Update() but this seems to update the datasource as well and totally bypasses the "global update" functionality I hope to obtain by using the Dataset.AcceptChanges() method.
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|