|
I'm developing a VB6 program to draw boxes. I'm stuck with the programming. I've done about 90% of the functionality. I'm using teeChart from Steema software and works pretty fine. My problem is about box walls. Up to now I can draw them as lines in space. That implies that the are transparent. My client is asking for non transparent walls.
Do some body have any hint. I think my problem could be solved drawing 3d planes in OpenGL but I don´t now where to start.
The beginning could be a good starting point. What's OpenGL?
Greetings from México
quijoteMX
|
|
|
|
|
qujoteMX wrote: The beginning could be a good starting point. What's OpenGL?
Wow.
Well, first of all, VB6 is outdated, clunky, underpowered and nasty. Why are you writing software using it ?
OpenGL is the competitor to DirectX. I am not sure if VB6 can use DirectX, perhaps through COM. Using DirectX or OpenGL, your whole UI needs to be drawn using it, if you're not already using it, I doubt you can start now.
If you're just drawing a box using GDI, I guess your best bet is to flood fill them.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi, i was wondering if anyone out there would be able to help me with (i think a simple) task that i am trying to do in VB, preferably VB6, however i do have .NET 2003.
The problem:
i am able to do basic stuff in (mostly) VB6 but i have been trying to figure out how to make a programme to automatically save a picture from a certain address of a website.
i have a made a simple broswer using ie controls in VB6 but what i rly want to do is have a line or two of code in the programme that saves a picture to a file locally.
The reason:
on the met office website they have got IR satelite pictures of weather and i have been downlaoding the pictures manually for a while now and it's getting tedeous, i download them becasue of the nice looking image sequance they make when you run them like a movie :P it's just very interesting, anyway enough of all that talking....
can anyone help? i would be very happy if they could
|
|
|
|
|
First of all, don't learn VB6, it's a dead language, and it sucks.
If you know the exact images you want, you can just do a HTTP request in .NET code to get the image data and save it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
so if i google something like "HTTP request in .NET" and/or in the msdn i should find it.
thanks for replying.
|
|
|
|
|
Hello. I want to know How I can Load a data into Textbox from DataGride Where I clicking on the one cell or Row on it? But it is DataGrid, Not a DataGridView. In VB.Net 2005
Thanks avryone.
|
|
|
|
|
try following code snippent at Double click event of datagrid
If dgvServices.CurrentRowIndex = -1 Then Exit Sub<br />
If Not dgvServices.Item(dgvServices.CurrentRowIndex, 0) Is Nothing Then<br />
txtServiceName.Text = dgvServices.Item(dgvServices.CurrentRowIndex, 1)<br />
txtPrice.Text = dgvServices.Item(dgvServices.CurrentRowIndex, 2)<br />
Else<br />
<br />
End If
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
hi
i have sql statement that take value from 2 table how can i fill the data set with which table name
SqlSec = "Select s.SectionID, s.JoinedSection,c.Priority<br />
From [Section] s,Course c <br />
Where s.CourseID =c.CourseID AND SectionID in(select SectionID <br />
from Slot where SlotID= " & currentslot & ") <br />
ORDER BY c.Priority" <br />
Dim DataAdapter1 As New OleDb.OleDbDataAdapter(SqlSec, con)<br />
DataAdapter1.Fill(Sections, "Section") ' fill the data setits actually section and course tables
it give error msg (No value given for one or more required parameters)
|
|
|
|
|
I don't really understand what you want to do with your first question, perhaps if you explain how you want to use it?
The error message means that you have one or more names in your query that doesn't exist in the database. Check the spelling of the table and field names. Also, is SlotID a numeric field, and does currentslot contain a number?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi asha_s
asha_s: Wrote|
i have sql statement that take value from 2 table how can i fill the data set with which table name
You have a Join? and you want to fill it in a dataset ?
Next thing, your SQl statement is Clumsly written
Select s.SectionID, s.JoinedSection,c.Priority
From [Section] s,Course c
Where s.CourseID =c.CourseID AND SectionID in(select SectionID
from Slot where SlotID= "currentslot")
ORDER BY c.Priority"
Is "currentslot" a Variable or parameter that need to be passed ?
Another thing,The below Statement is not Complete,i assume you have declared and initialized your connection obect and declared your connection string, but i dont trust you have declared the dataset and the parameter object.if so remove that name and use "?", to show that this value is not known until runtime,this can be done only for oledb.
Dim DataAdapter1 As New OleDb.OleDbDataAdapter(SqlSec, con)
DataAdapter1.Fill(Sections, "Section")
the above can be written as
dim ds as new dataset
dim DataAdapter1 as new oledb.oledbdataadapter(sqlsec,con)
dataadapter1.SelectCommand.Parameters.Add("SlotID", inputVar)
dataadapter1.fill(ds)
If you have given enough info or Clear info for us we would help you.
Hope it helps
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
|
i've created an vb.net applicatin(desktop) which works fine in 1024*760 but controls alignment will change <then or="">then 1024 so anybody have a solution come on tell me ma
adsf
|
|
|
|
|
Set the align properties of your controls so they move as you'd like when the form resizes.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I think you mean the anchor properties
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes, you are correct.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have written some code that detects when the computer is locked using the SessionSwitchEventHandler but want to detect when the screensaver has been activated.
Hope someone can help
Thanks
Graeme G
I am always greteful for any help!
|
|
|
|
|
|
My application runs on a network of 15 to 16 clients on a SQL Server 2000. Some of the modules perform transaction, i.e. they run more than one sql. I have tied the different sql statemels under the following procedure:
con.Open()
trans = con.BeginTransaction()
Try
'First Sql
cmd = New SqlClient.SqlCommand("INSERT INTO table1(col1, cl2, col3, col4) "VALUES('" & col1 & "','" & col2 & "','" & col3 & "','" & col4 & "')", con, trans)
cmd.ExecuteNonQuery()
'Second Sql
cmd = New SqlClient.SqlCommand("update table2 set colbl='" & col1 & "',colcl='" & t & "' where colbl =" & col1 & "", con, trans)
cmd.ExecuteNonQuery()
trans.Commit()
Catch ex As Exception
trans.Rollback()
End Try
con.Close()
Out of 700-800 inserts and updates, the system ignores the update statement. The value is inseted through the first statement, but it is not updated. So it shows a wrong balance. I am not able to diagonise the actual cause. The network is very good. My question is :
1. Even if the network fails, why does the rollback doesn’t happen.
2. Is my above code a right way for a commit procedure.
Please help. Thanks in advance.
|
|
|
|
|
The real way to do this is to put it all in a stored proc. This code seems to me like it should work, but a stored proc just makes more sense, and also allows you to pass parameters in a safer way, this code is ripe for SQL injection attacks.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Thanks so much for taking so much interest in reading and replying to my query.
Well, as advised by you I have asked my team to start working with paramaterized queries and sooner we will update it.
In the mean time what is churning me that why the Rollback doesnt take place. My application runs three modules. Each runs two sql statement; one Insert and one Update.
Insert is running fine in all the three modules. Update is running fine in two modules.
But in one problamatic module, the sql insert command is generated but the consequent update field is not getting updated.
Its like that say if Rs. 100 is added to an account in say Table1 than Table2 which holds all the balances of the accounts in Table1 needs to be updated.
Because its not getting updated, it shows a wrong balance. Thought the number of errors are one out of 1000 updates.
I have tested this commit part in my server by giving some wrong sql query and the rollback takes place. But while its live its giving no solution to us.
Can you please help with this commit part. Weather my process of commit is right. As such the transaction is very simple. If my query has any problem, than how come 999 time its workig fine and creating error just once.
Thanks again in advance.
|
|
|
|
|
vb_buddy wrote: In the mean time what is churning me that why the Rollback doesnt take place.
Since you've made the big mistake of using string concantentation to build the SQL statements, various input CAN create a valid statement, but that executes in a successful, but not as you expected, manner. It's entirely possible the update IS running successfully. So, since there's no error, there's no rollback either.
Check the input that's going to these statments.
|
|
|
|
|
Well, here is the code, I have also given the SQL field type.
Anyways, what are string concatenation. What is the difference between insert through string concatenation and parameterized queries. Can you please focus me that where am i going wrong.
con.Open()
trans = con.BeginTransaction()
Try
cmd = New SqlClient.SqlCommand("INSERT INTO issuec(cen, cses, ctdate, cttime, caction, camt, cde, cdch, crt, crr, cda, uc, cty) " & _
"VALUES('" & cen & "','" & frm.txtcses.Text.Trim & "','" & s_date & "','" & s_time & "','" & temp & "','" & a11 & "','" & sdepo & "','" & b & "','" & type & "','" & reason & "','" & damage & "'," & ccde & ",'" & cs & "')", con, trans)
cmd.ExecuteNonQuery()
cmd = New SqlClient.SqlCommand("update master set ccb='" & newbalance & "', cact='" & t & "',cldate='" & s_date & "', cl='" & lc & "', cde=" & cnt & ", cty='" & cs & "' where cen=" & cen & "", con, trans)
cmd.ExecuteNonQuery()
trans.Commit()
Catch ex As Exception
trans.Rollback()
End Try
con.Close()
Field type:
Sql1:
------
cen: numeric
cses: int
ctdate: datetime
cttime: char
caction : char
camt: numeric
cde : numeric
cdch : numeric
crt : char
crr : varchar
cda : char
uc : int
cty : char
Sql2:
------
ccb : numeric
cact : char
cldate : datetime
cl : cahr
cde : int
cty : char
cen : numeric
I have also given the field type for the above code in SQL.
Regards
|
|
|
|
|
vb_buddy wrote: What is the difference between insert through string concatenation and parameterized queries.
Parameterized queries, using SqlParameter objects, automatically escape certain characters for you. These characters, like the ' , can completely change the meaning of an SQL statement.
vb_buddy wrote: Can you please focus me that where am i going wrong.
I already did. You're using string contantenation to build SQL statements.
BTW: Your SQL column names are utter junk. What column holds what data?? You've thrown away the entire meaning of "self documenting code".
|
|
|
|
|
To further what Christian said, execute the statements in a SQL Query Analyzer session to ensure that the update is in fact working against a field that exists. The statements listed show an insert into table1, but an update against table2.
Tim
|
|
|
|
|
When you update, you compare the colbl field with the value in col1 as a numeric value, but then you set the field with col1 as a string value. What are the types of the col1 variable, and the colbl field, really?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|