|
hello .. i hd a form , what i want is that the user will search the database either by entering Party Name or By date ..I hd succesfully acheived this , but the problem is that , when i search for partyname , the result are showned in datagrideview , but when u tried to search again the previous result does not go , its still present in datgridview..how do i get out of it ...
for much better understanding i hd posted image down there ..plz help me out
Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Da = New OleDb.OleDbDataAdapter("Select * from demo where DateOfPurchase = '" + txtsdateofpurchase.Text + "'", Cnn)
Da.Fill(ds, "demo")
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()
End Sub
|
|
|
|
|
I don't use the tableadapters that often; it looks however as if you're continuously adding records. Try clearing the datasource beforing filling.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I'm looking for a Control or example that works similar to the Excel Text Import Wizard. I would like to be able to open a text file in something like a text box and then draw lines where the data will be parsed into either a CSV file or Excel File. I've searched the internet and saw plenty of questions like this but never a answer.
Thanks
|
|
|
|
|
Member 7743805 wrote: I've searched the internet and saw plenty of questions like this but never a answer.
Because it's not a question, it's a request for code. There's no built-in mechanism to do this, so somebody will have to write it. Those who did, don't like sharing their code for obvious reasons.
So, my first question would be; are you planning on writing one (in which case I can provide hints on how), or just looking for a free implementation?
There are a lot of tutorials on importing CSV-files, and MSDN has explanation on a custom Paint-event.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I started writing one and would appreciate any tips you can point me to.
I was hoping maybe there was a custom control even if it was commercial. I really would like to use a fixed font like Courier.
I would like to put a ruler vertical and horizontal around a textbox with a text file loaded into it. Then mark the columns and return the position of each marked. Also would like to be able to mark the vertical to possibly exclude certain sections.
Then these could be setup and saved by the user as templates so that each time they get these text file it would be defined for them. Since each could be a little different.
The vertical lines would be used to wipe out any sections with headers or footers in the text files that are being sent. This would need to return the row of the data.
Again any hints, tips, or tricks would be great.
|
|
|
|
|
Member 7743805 wrote: I really would like to use a fixed font like Courier.
Each control has a Font property.
Member 7743805 wrote: I would like to put a ruler vertical and horizontal around a textbox with a text file loaded into it.
I'll bet that CodeProject has an article on that. And yes, this was the first result[^] according to Google.
Member 7743805 wrote: <layer> Then mark the columns and return the position of each marked.
You can easily determine the location of the cursor, and MSDN has an example on owner-drawn painting.
Member 7743805 wrote: Then these could be setup and saved by the user as templates so that each time they get these text file it would be defined for them.
..not in a standard control. Again, "someone" will have to write it. Yes, there are examples out there, but there's little chance that there's a control that satisfies all your wishes.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi guys ,
I have tried to make a parametric report in visual studio 2010 by using VB.net, but i haven't done yet.
can anybody help me how to do this ?
|
|
|
|
|
hi, guys i have function for get multi values from a datareader
is working fine but when i have two or more data only i can get the las register
how i can get all register ??
Public Class OracleDataClass
Public ORAVALUEA As String
Public ORAVALUEB As String
Public ORAVALUEC As String
Public ORAVALUED As String
End Class
Function OracleQuerys(ByVal orasql_query As String, ByVal ORAVALUEA As String, ByVal ORAVALUEB As String, ByVal ORAVALUEC As String, ByVal ORAVALUED As String) As OracleDataClass
Try
Dim OracleGetInfo As New OracleDataClass
Dim OracleDataClass As
orasql_querys = orasql_query
oracle_cmd_command = New OracleCommand(orasql_query, conoracle)
oracle_data_reader = oracle_cmd_command.ExecuteReader
While (oracle_data_reader.Read())
OracleGetInfo.ORAVALUEA = oracle_data_reader.Item(ORAVALUEA)
OracleGetInfo.ORAVALUEB = oracle_data_reader.Item(ORAVALUEB)
OracleGetInfo.ORAVALUEC = oracle_data_reader.Item(ORAVALUEC)
OracleGetInfo.ORAVALUED = oracle_data_reader.Item(ORAVALUED)
End While
Return OracleGetInfo
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
oracle_data_reader.Close()
End Function
Dim GetDataOracle As OracleDataClass = OracleQuerys(orasql_query, ORAVALUEA, ORAVALUEB, ORAVALUEC, ORAVALUED)
client_product_number = GetDataOracle.ORAVALUEB
client_phone_number = GetDataOracle.ORAVALUEC
thanks for the help and time
|
|
|
|
|
Yes, that will onyl return the last value read because you're storing every single value in the same single-valued variables, overwriting the values from the previous pass through your While loop.
You have to use some List variant or arrays to return more than one set of values.
|
|
|
|
|
ok nice i will use a Array thanks
|
|
|
|
|
look this my array
Function OracleQuerys(ByVal orasql_query As String, ByVal ORAVALUEA As String, ByVal ORAVALUEB As String, ByVal ORAVALUEC As String, ByVal ORAVALUED As String) As ArrayList
Try
Dim OracleGetInfo As ArrayList = New ArrayList
orasql_querys = orasql_query
oracle_cmd_command = New OracleCommand(orasql_query, conoracle)
oracle_data_reader = oracle_cmd_command.ExecuteReader
While oracle_data_reader.Read()
OracleGetInfo.Add(oracle_data_reader(ORAVALUEA))
OracleGetInfo.Add(oracle_data_reader(ORAVALUEB))
OracleGetInfo.Add(oracle_data_reader(ORAVALUEC))
OracleGetInfo.Add(oracle_data_reader(ORAVALUED))
End While
Return OracleGetInfo
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
oracle_data_reader.Close()
End Function
i get the Data in the fills but how i can pass for example to varible call Name? on on ORAVALUEA
Thanks for your time and help
|
|
|
|
|
You REALLY need to pickup a beginners book on C#. You're just guessing at how this stuff works and wondering why it doesn't. You don't have the faintest idea of how these basic constucts work.
Create a class or structure to hold the items for one record. Then you can add that to a List and return that instead.
|
|
|
|
|
ok, dude thanks for your time and help.. i will check the book
thanks alot!
|
|
|
|
|
I Have A Form Called Invoice And Has A Data grid view That Contains The Details Of the Specific Invoice
One Field In The Invoice Details Data grid view Called ItemIndex
So When user Enters An UnExisted ItemIndex An Error occurs With Message "Item Not Found" So I Created Another Form When This Error Occurs A Form Called Item List Opens With A List Of The Available Items So When The User Clicks On An Item The Info In That Specific Row Should Be Transferred to Invoice Details Datgridview In The Invoice Form
The Item Index Form Can Be Called From More Than One Form In The Application As The Item Index Help
Can Be Requested From Purchased Or Transfer Forms.....
Can Anyone Help With This Issue Please ?????
Many Thanks In Advance
|
|
|
|
|
BTW it's pretty rough to understand what you mean at all. Why not use punctuation and normal writing style to make it easier for someone who wants to help???
As far as I understand you want to transfer a row from one DataGridView to another. I didn't test that, but – assuming they have the same set of columns – I'd consider to transfer the relevant row from the DateGridView's DataSource (dataset / table) to the other grids DataSource.
|
|
|
|
|
I Have Solved The Problem
How:
In Form Form1
[CODE]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MySearchForm As Form2
MySearchForm = New Form2()
MySearchForm.txtSearch.Text = txtsearchCriteria.Text
If MySearchForm.ShowDialog() <> DialogResult.OK Then
Return
End If
TextBox1.Text = MySearchForm.MySearch.STCODE
TextBox2.Text = MySearchForm.MySearch.STDESC
TextBox3.Text = MySearchForm.MySearch.STSELA
TextBox3.Text = MySearchForm.MySearch.STSELC
TextBox4.Text = MySearchForm.MySearch.STSELO
MySearchForm = Nothing
End Sub
[/Code]
In Form2
[CODE]
Public MySearch As New clsStock 'A Public Class Created To Collect Info From Specific Query
Private Sub gvStock_RowHeaderMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles gvStock.RowHeaderMouseDoubleClick
With MySearch
.STCODE = gvStock.Rows(e.RowIndex).Cells("STCODE").Value
.STSELA = gvStock.Rows(e.RowIndex).Cells("STSELA").Value
.STSELB = gvStock.Rows(e.RowIndex).Cells("STSELB").Value
.STSELC = gvStock.Rows(e.RowIndex).Cells("STSELC").Value
.STSELO = gvStock.Rows(e.RowIndex).Cells("STSELO").Value
End With
End Sub
[/Code]
I Hope Everyone Would Benefit from it
wahid kalo
|
|
|
|
|
Quote: Private Sub txtLunch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLunch.TextChanged
If Not String.IsNullOrEmpty(txtLunch.Text) Then
If txtLunch.Text >= 0 Then
Lunch = txtLunch.Text
SubFnB = Breakfast + Lunch + Dinner + Supper + Snack + Beverage + Grocerries
txtSubFnB.Text = SubFnB
End If
End If
End Sub
Private Sub txtDinner_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDinner.TextChanged
If Not String.IsNullOrEmpty(txtDinner.Text) Then
If txtDinner.Text >= 0 Then
Dinner = txtDinner.Text
SubFnB = Breakfast + Lunch + Dinner + Supper + Snack + Beverage + Grocerries
txtSubFnB.Text = SubFnB
End If
End If
End Sub
Private Sub txtSupper_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSupper.TextChanged
If Not String.IsNullOrEmpty(txtSupper.Text) Then
If txtSupper.Text >= 0 Then
Supper = txtSupper.Text
SubFnB = Breakfast + Lunch + Dinner + Supper + Snack + Beverage + Grocerries
txtSubFnB.Text = SubFnB
End If
End If
End Sub
Private Sub txtSnack_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSnack.TextChanged
If Not String.IsNullOrEmpty(txtSnack.Text) Then
If txtSnack.Text >= 0 Then
Snack = txtSnack.Text
SubFnB = Breakfast + Lunch + Dinner + Supper + Snack + Beverage + Grocerries
txtSubFnB.Text = SubFnB
End If
End If
End Sub
Private Sub txtBeverage_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBeverage.TextChanged
If Not String.IsNullOrEmpty(txtBeverage.Text) Then
If txtBeverage.Text >= 0 Then
Beverage = txtBeverage.Text
SubFnB = Breakfast + Lunch + Dinner + Supper + Snack + Beverage + Grocerries
txtSubFnB.Text = SubFnB
End If
End If
End Sub
Private Sub txtGroceries_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtGroceries.TextChanged
If Not String.IsNullOrEmpty(txtGroceries.Text) Then
If txtGroceries.Text >= 0 Then
Grocerries = txtGroceries.Text
SubFnB = Breakfast + Lunch + Dinner + Supper + Snack + Beverage + Grocerries
txtSubFnB.Text = SubFnB
End If
End If
End Sub
Private Sub txtAllowance_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtAllowance.TextChanged
If Not String.IsNullOrEmpty(txtAllowance.Text) Then
If txtAllowance.Text >= 0 Then
Allowance = txtAllowance.Text
End If
End If
End Sub
Private Sub txtSubFnB_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSubFnB.TextChanged
If Not String.IsNullOrEmpty(txtSubFnB.Text) Then
If txtSubFnB.Text >= 0 Then
SubFnB = txtSubFnB.Text
Total = SubFnB
txtTotalUsage.Text = Total
txtWalletCash.Text = Wallet
Wallet = (Wallet + Allowance) - Total
End If
End If
End Sub
Sorry for asking so many things.
My SubFnB is displayed correctly but my wallet isn't.
It keeps on multiplying the total
How to fix this?
|
|
|
|
|
Okay, I've solve it myself by assigning the wallet calculation to another variable.
|
|
|
|
|
Hello,
My VB.NET application currently securely downloads a username and password required to access a web service that contains sensitive data. The problem I face now is storing that username and password on-disk in a secure manner for future use.
I've looked into various encryption algorithms etc. but all involve storing some kind of key for decryption locally (rendering the encryption a bit of a joke) or hard-coding the key into the application (difficult-to-maintain and just about as useful as the last option). I welcome any suggestions as to how relatively secure local storage of a username and password might be accomplished. Despite hours of wracking my brains poking about in the System.Security.Cryptography namespace I'm no closer to finding a solution than I was at the start.
SixOfTheClock
A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.
modified 2-Sep-12 5:18am.
|
|
|
|
|
Not the answer you're going to want to hear, but it can't really be done.
If you really want it to be secure, you'll have to require the user to enter a master password. Other popular programs do this too. Typically, you will be given the option of encrypting multiple passwords using one master password (most secure) or encrypting the passwords using a built-in key (which would be stored in plain text somewhere).
You could also use multiple layers of indirection (e.g., a config setting that points to a file that stores the path the encryption key is stored in) to make it harder for somebody to obtain the encryption key, but it's not really any more secure (just harder to access).
|
|
|
|
|
Ah, I thought as much. I'll take a look into these options, thank you very much indeed!
A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.
|
|
|
|
|
actually you can. The solution, however, is in using a .NET secure string for the password and store the secure string in a file. Take a look(bing it) at how to use secure strings with powershell, if you're using win 7 then it should be a piece of cake.
L. Carlos Rodriguez
DCU, LLC
Braselton, GA 30517
|
|
|
|
|
..and there is me reading the file, and shouting your password in the streets. Any other solutions?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
...there's nothing better than making passwords public so you can shout them to the world, that's why we use the.NET secure string functionality for batch files protections at both the DOL and Treasury. But then again, this is the government and we don't know what we're doing....
Sorry I led you in the wrong path....
Good luck
|
|
|
|
|
dcu.lcr wrote: ...there's nothing better than making passwords public so you can shout them to the world, that's why we use the.NET secure string functionality for batch files protections at both the DOL and Treasury.
For batch files?
Let me rephrase that; any secret that's stored, isn't.
dcu.lcr wrote: But then again, this is the government and we don't know what we're doing....
You working for the government is not an argument, nor does it validate your statement.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|