|
This is my first post on this site. Im a new VB.Net programer that has been tasked with writing a app to dial a BBS, Navigate the menu system and then upload a file using X,Y, or Z modem.....
Most all my experience has had to deal with database, and file parsing and I am swimming in deap water here. I have looked around online nad not found a good How TO aritcle on this type of thing. I know BBS is from a by-gone era, but my company has to deal with this sort of thing a lot. Currently they use Expect script and Unix Shell scripting to domost of this sort of thing, but by dept. wants to do it in VB.net from a windows box.
can anyone out there help or point me to some good resources on this sort of thing.
Thanks in advance...
|
|
|
|
|
Why do they want that ? Surely there are free programs to do that, I thought one came with Windows ? It used to.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Not that I am aware of...
The reason I need this is because I have been tasked with creating an application the would connect to a State run BBS and upload a file to them, then download a response file from them. This application would have to navigate through the menu options to get to the correct location before uploading.
If you know of some app that came with or comes with Windows..... let em know.
|
|
|
|
|
I have a MS-Access table is bound to a datagridview that I need to do is programatically add rows based on input from the user. Below is a section of the code that I'm using to accomplish this. When the AcceptChanges statement is executed, the "System.Data.RowNotInTableException" error is thrown.
How can I add data to this bound table?
schedRow = CType(CType(Me.PP_ScheduleBindingSource.AddNew, DataRowView).Row, TCDataSet._PP_ScheduleRow)<br />
<br />
schedRow.SchedDate = dTmp<br />
schedRow.SiteID = Me.ComboBox1.SelectedValue<br />
schedRow.EmpID = clbTemp.CheckedItems.Item(j).ToString<br />
schedRow.TimeOpen = sOpenTime<br />
schedRow.TimeClose = sCloseTime<br />
<br />
schedRow.AcceptChanges()
|
|
|
|
|
Your problem is that you're calling AcceptChanges() . I suggest reading the documentation on that method. It doesn't do what you think it does.
AcceptChanges tells the dataset/datatable that it should set the status of every row in the set/table to Unchanged. This means that there is no longer any Added, Modified, or Deleted rows in the set/table. So when you finally call Update to write the changes back to the database, there are no changes to write back since every row is now tagged Unchanged.
You CAN call this on individual rows, though, in your sample code, this is not necessary.
The bottom line is the exception is thrown because you created a new row, but you didn't add it to a table. Then you called AcceptChanges on that row. You do not need to AcceptChanges at all. Remove the AcceptChanges line and add the code to add the new row to the target tables Rows collection.
|
|
|
|
|
It appears that the following code snipet sucessfully adds a row to the database. This allows me to programatically add rows to a table that is bound to a datagridview on my form.
This is exactly what I needed to do! Thank you very much.
Dim schedDR As TCDataSet._PP_ScheduleRow<br />
<br />
schedDR = CType(CType(Me.PP_ScheduleBindingSource.AddNew, DataRowView).Row, TCDataSet._PP_ScheduleRow)<br />
<br />
schedDR.SchedDate = "2/29/2008"<br />
schedDR.SiteID = "ACME"<br />
schedDR.EmpID = "1234"<br />
schedDR.TimeOpen = "9:00 AM"<br />
schedDR.TimeClose = "5:00 PM"<br />
<br />
Me.PP_ScheduleBindingSource.EndEdit()<br />
Me.PP_ScheduleTableAdapter.Update(Me.TCDataSet._PP_Schedule)<br />
|
|
|
|
|
Hi there,
i am currently implementing a windows service that needs to encrypt some data using X509 certificates. The user shall be able to select the certificate in the configuration GUI of the service. As the GUI runs as the current user and the service runs as local system, they obviously can´t access the same certificate stores.
I want to present the user a collection of certificate stores that the local system user is able to access. Is there any way to access the certificates of another user?
Any help would be appreciated, thanks in advance.
Sascha
|
|
|
|
|
This might work, but you'd have to have code in your service to impersonate the user and load their profile in order to get access to their certificate store. Loading another users profile can take a VERY long time.
I've never done this, so I don't have any example code. The best I've got to give is this[^].
|
|
|
|
|
Sorry to be dense, but what is the control that looks something like this, with two columns, 1 for the variable and 1 for the data. I see it a lot. Is this a datagridview?
Thanks
+ Box1 (can be maximized or minimized to show
Item 1 | Item1 value (might be dropdown, etc.)
Item 2 | Item2 value
- Box2 (minimized
+ Box3 (maximized)
Item 1 | Item1 value (might be colordialog, etc.)
Item 2 | Item2 value
|
|
|
|
|
try TreeView
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
No, I don't think it's a treeview.
You can see an image here: www.cstrader.com/image1.png
|
|
|
|
|
oh... this is a PropertyGrid
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Hi!
I have a piece of code in which 2 entries are taken from the user:
1. Bank Name
2. Bank Logo (an image)
then, an sql query is created to store the information into a mysql database in which the field names and their datatypes are given below respectively:
1. Bank_Name - Varchar(50)
2. Bank_Logo - Long blob
both fields cannot contain null values. THe code is pasted below:
<br />
<br />
Public Function InsertBank(StrQuery as string, name as String, image() as byte)<br />
{ <br />
Dim Cn As New Odbc.OdbcConnection(ConString)<br />
Dim cmd As New Odbc.OdbcCommand<br />
cmd.CommandText = strQuery<br />
<br />
cmd.Parameters.Add("@BNAME", Odbc.OdbcType.VarChar)<br />
cmd.Parameters.Add("@PIC", Odbc.OdbcType.Binary)<br />
<br />
cmd.Parameters("@BNAME").Value = name<br />
cmd.Parameters("@PIC").Value = image<br />
<br />
cmd.Connection = Cn<br />
Cn.Open()<br />
cmd.ExecuteNonQuery()<br />
Cn.Close()<br />
}<br />
the strQuery which i am passing to the function is like below:
"Insert into tblBank (Bank_Name,Bank_Logo) values (@BNAME,@PIC)"
However, when i call the function i get an error that bank_name cannot contain null value. I have rechecked again and again, but the bank name does not have any null value, it is passing a value from the text box and it is passed perfectly well...i dunt know what the problem is...kindly help...its urgent!
|
|
|
|
|
I don't use MySQL so my answer may be wrong.
Your "function" is badly written. It doesn't return a value, so it's a Sub, not a Function. Your code also specifies that a query string be passed to it, though that string MUST use the two hard-coded parameters in the code.
Your also not specifying the size of the fields when you create the parameters. I don't know if this is causing the problem, but I'd fix it to be sure:
Public Sub InsertBankLogo(ByVal BankName As String, ByVal BankLogo() As Byte)
Dim cn As New ObdcConnection(ConString)
Dim cmd As New OdbcCommand("INSERT INTO tblBank (Bank_Name, Bank_Logo) VALUES (?, ?)", cn)
cmd.Parameters.Add("@BNAME", OdbcType.VarChar, field length).Value = BankName
cmd.Parameters.Add("@PIC", OdbcType.Binary, field length).Value = BankLogo)
cn.Open()
cn.ExecuteNonQuery()
cn.Close()
End Sub
There's about a dozen more things wrong with this, but the biggest part is that you're not specifying the length of the fields that the SQL code is expecting.
|
|
|
|
|
given a vector of dates (past dates and future ones), how can one extract a new vector showing remaining future dates from today
|
|
|
|
|
By iterating over the collection and pulling out dates that are in the future ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
It saddens me that some people have such poor logical ability.
|
|
|
|
|
On the otherhand I'm feeling fairly secure in my job ..
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Please see my code below, for some reason it fails. can you help
definitions: valdate = date today
ipos = an indicator = +1 or -1 depending if a bond was bought or borrowed.
notional = amount of bond bought or borrowed
d1 = date when bond was launched
d2 = date when bond matures
freq = frequency of interest repayments
coupon = interest rate used to calculate coupon repayments
Function bondcashflow(valdate, ipos, notional, d1, d2, freq, coupon)
Dim p, m As Integer
Dim v()
Dim cashflow()
ReDim cashflow(2, m) As Variant
Dim n As Long
n = Application.Round(DateDiff(dateinterval.Day, d1, d2) / 365, 0) * freq
For i = 0 To n - 1
If freq = 1 Then
v(i) = DateAdd(dateinterval.Year, i, d1)
ElseIf freq = 2 Then
v(i) = DateAdd(dateinterval.Month, 6 * i, d1)
ElseIf freq = 4 Then
v(i) = DateAdd(dateinterval.Month, 3 * i, d1)
Else: v(i) = DateAdd(dateinterval.Year, 12 * i, d1)
End If
m = 0
If valdate < v(i) Then
m = m + 1
End If
Next i
p = n - m
For k = 0 To p - 1
cashflow(k, 1) = v(m)
Do While k < p - 1
cashflow(k, 2) = ipos * coupon * notional
Loop
Next k
cashflow(p - 1, 2) = ipos * (notional + coupon * notional)
bondcashflow = cashflow
End Function
|
|
|
|
|
I have an asset (bond) with start date, coupon payment dates and the maturity date. I would like to write a programm to give me the next cashflow dates any time during the life of the bond.
|
|
|
|
|
OK, sounds like fun. Did you want to pay someone to write it for you, or were you hoping to have a shot at it yourself ? I assume you understand the maths behind what you want to calculate, if not, there's google. Maths is what PCs do best, the code should be straightforward, but if you try to impliment something and it doesn't quite work, post your code and we'd love to help you.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Danisto wrote: I have an asset (bond) with start date, coupon payment dates and the maturity date. I would like to write a programm to give me the next cashflow dates any time during the life of the bond.
Cool. Did you have a question in there somewheres? Or are you looking for someone to do your work for you?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
I am Developing a software using VB6.0 as Frontend and MSAccess as Backend. I have used ADODC component and ODBC connection string to connect to DB. I am looking for a code to SEARCH THE DB for a specific record in a specific field and then DISPLAY THE SAME RECORD in the corresponding objects in the Frontend. For e.g:- Suppose, if I gave criteria as Resolution Number = 143162216 using a TextBox, then the code should search the entire table under the column named 'Resolution_Number' and if that No. is found, then the whole information regarding that Resolution Number is displayed at the frontend application (VB6.0) in that specific object,e.g:- for 'User Name' I have used a TextBox, then the 'Name' in the table should be displayed in that TextBox, for 'Type Of User' I have used a ListBox, then the 'User Type' from the table must be displayed in that ListBox.
I tried the 'Find' property of the 'RecordSet' object, but it did not worked properly. Also i tried the assignment operator(=) to assign the value of the field in the table to the corresponding object (Textbox, ListBox,etc.), but that also didn't worked.
Awaiting for help.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
Thank you - that is truly the most annoying post ever.
Why are you using VB6 ? Do you have no choice, or do you just hate yourself ?
It sounds to me like you're asking how to write basic SQL.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|