|
You need to be a bit more descriptive about your problem.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I created a setup for my small application using the click once deployment method.But I also want to execute another *.exe file in setup the process. i.e. I want to execute another *.exe file after the setup has been completed.
Do you guys know how to do it?
|
|
|
|
|
You don't have an option to run an "after install" custom action while using ClickOnce. it's not supported at all.
A better soultion would be to have this functionality built into your application, giving it a kind of "self repair" feature. If certain items do not exist in the configuration the app is expecting, call your setup process.
|
|
|
|
|
How do I get the selected value from a combo box and use it in a database update.
This is the code to update the datarows. I am not sure what hte syntax is or the method, etc for getting the selected value which is also the primary key of the database table.
' Locate the row you want to update.<br />
Dim ssRow() As Data.DataRow<br />
ssRow = lpDataSet.Tables("tbl_store_sched").Select("ss_id = ")
|
|
|
|
|
AAGTHosting wrote: How do I get the selected value from a combo box and use it in a database update.
You said it yourself. If the ComboBox is bound to a DataTable, ComboBox1.SelectedValue returns the value of the selected item in the combo.
|
|
|
|
|
I'm writing a console application. I am trying to change directory path.
I use a line like below.
Environment.CurrentDirectory = "C:\somedirectory"
The line compiles, runs without throwing an exception, but does not change the directory.
Any other commands or tricks to try?
|
|
|
|
|
You can't do what you trying to do.
Changing the "current directory" only does so for the current process, i.e.: your app. Any changes you make the the "current directory" do not get reflected by the shell that launched your app. The shell (CMD) maintains its own "current directory".
|
|
|
|
|
|
How can i refresh datagrid in vb.net.
I want to display color in one cell in grid but when it loads first time it is working here is my code
Public Class Dialog_Colorazione
Const YEAR_START As Integer = 2005
'function to fill the combo with year
Private Sub LoadComboBoxes()
cboYear.Items.Clear()
cboYear.SelectedIndex = -1
Dim i As Integer
For i = Date.Today.Year To YEAR_START Step -1
cboYear.Items.Add(i.ToString())
Next
cboYear.SelectedIndex = 0
' loadcolor(cboYear.SelectedItem)
End Sub
'till here function to fill the combo with year
Private Sub Dialog_Colorazione_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'calling functions to fill the combo and display the color details
'cboYear.SelectedText = Today.Year
LoadComboBoxes()
' loadcolor(cboYear.SelectedItem)
'cboYear.SelectedIndex = 1
dgvFatturato.Refresh()
End Sub
'function the collect and fill the grid with the colors in the selected year
Public Function loadcolor(ByVal year As Integer)
Dim currentyear As Integer = Today.Year
Using connection As New OleDbConnection(My.Settings.BCS_ACCConnectionStrin g & ";Jet OLEDB:Database Password=" & Costanti.strAccessDbPassword)
connection.Open()
Dim adpt As New OleDb.OleDbDataAdapter("SELECT RefYear,LowRange,UpRange,ColorName FROM ACC_COLORI_FATTURATO WHERE RefYear=" & year & "", connection)
Dim ds As New DataTable
adpt.Fill(ds)
'added on 08/12/2007 to display color in the datagrid
If ds Is Nothing Or ds.Rows.Count = 0 Then
ShowMessage("Nessun dato per i criteri selezionati")
dgvFatturato.Visible = False
Else
dgvFatturato.DataSource = Nothing
dgvFatturato.Visible = True
dgvFatturato.DataSource = ds
ds.Columns(0).ColumnName = "Anno"
ds.Columns(1).ColumnName = "Maggiore da"
ds.Columns(2).ColumnName = "Minore da"
ds.Columns(3).ColumnName = "Colore"
' ds.Columns(4).ColumnName = "ID colore" 'commended on 11/01/2008 for hiding the coloumn
'Added on 11/01/2008
' Dim year1 As Integer = cboYear.SelectedItem
Using connection1 As New OleDbConnection(My.Settings.BCS_ACCConnectionStrin g & ";Jet OLEDB:Database Password=" & Costanti.strAccessDbPassword)
connection1.Open()
Dim ds1 As New DataTable
Dim adpt1 As New OleDbDataAdapter("select color from ACC_COLORI_FATTURATO WHERE RefYear=" & year & "", connection)
adpt1.Fill(ds1)
If dgvFatturato.RowCount > 0 And ds1.Rows.Count > 0 Then
For Each row As DataGridViewRow In dgvFatturato.Rows
' For i As Integer = 0 To ds1.Rows.Count - 1
Dim colorn As Integer = ds1.Rows(row.Index).Item(0)
row.Cells(3).Style.BackColor = Color.FromArgb(255, Color.FromArgb(CType(colorn, Int32)))
Next
End If
connection1.Close()
End Using
''Till here
End If
'Till here added on 08/12/2007 to display color in the datagrid
connection.Close()
End Using
End Function
'till here function the collect and fill the grid with the colors in the selected year
'to collect and display the color information on change of the combo
Private Sub cboYear_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboYear.SelectedIndexChanged
loadcolor(cboYear.SelectedItem)
End Sub
'till here to collect and display the color information on change of the combo
Thanks....
modified on Friday, January 11, 2008 10:52:18 PM
|
|
|
|
|
OK. First, most of this code has nothing to do with your question. Post only the snippets you need to explain your question, not your entire codebase.
Member 4764094 wrote: I want to display color in one cell in grid but when it loads first time it is working
So what's the problem?? What's it doing that you don't expect?? What is it supposed to be doing??
BTW, your DeciamlToHexadeciaml function can be replaced with a single line of code:
Private Function DeciamlToHexadeciaml(ByVal number As Integer) As String
Return Hex(number)
End Function
Personally, I find that you probably don't need your function at all since typing Hex is much shorter than typing DeciamlToHexadeciaml to do the exact same thing.
|
|
|
|
|
Thank you for the replay.
Problem is
I am calling the function loadcolor in the page load and dropdown selected index change.
When the page loads first it is displaying color in the grid.
But after that it is not displaying color on load.but the same function works fine in selected index change. i think now it is clear to you. Any suggestions?
|
|
|
|
|
Member 4764094 wrote: i think now it is clear to you.
Think again.
Member 4764094 wrote: But after that it is not displaying color on load
Of course not. Load is only fired once in the lifetime of the Form.
I still don't get what the problem is. You're assuming I know more about your project than your decribing. You haven't described what you expect the code to do and you haven't even described what the code is really doing. Without these two critical pieces of information, there's nothing I can tell you.
|
|
|
|
|
hi all,
Is MAC OS Support DOS and their .bat file.
Can any one clear this doubt.
Thank you in advance.
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|
Senthil S wrote: MAC OS Support DOS and their .bat file
No.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
No, since Mac OS is based on a Linux kernel.
And what does this have to do with VB.NET?? Your question would have been better asked in some Mac forum. Sorry, but I firmly believe is using the right tool for the job.
|
|
|
|
|
hi all,
how i can check the system is already having dotnet framework or not.
is any coding is available???
thank you in advance
senthil.s
|
|
|
|
|
Other than having an installer check before your program is installed. Their is a 'Microsoft.NET' or similar name in the C:\Windows folder that contains folders with the .NET version as their name.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
hi Senthil S
go to your Control Panel and Add Remove
check it there
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
|
|
|
|
|
The .NET Framework versions installed will be entered as keys under the following HKEY_LOCAL_MACHINE key: "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP"
e.g., in VB you'll do something like:
Import Microsoft.Win32
...
Dim SubKey As String = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP"
Dim RegKey As RegistryKey = Registry.LocalMachine.OpenSubKey(SubKey, False)
If RegKey IsNot Nothing Then
Dim SubKeyNames() As String = RegKey.GetSubKeyNames()
'here you can examine the elements of the SubKeyNames array
'which will be the .NET Framework versions installed
RegKey.Close()
End If
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++ VB Edition: VB to C++/CLI converter
Instant C++ C# Edition: C# to C++/CLI converter
|
|
|
|
|
Hi all i need a application which we can pick a specific time and date..
example:if we take onlinebooking for reservation for anything we have to choose specific time and date which are available..
thanks inadvance
shilpa
|
|
|
|
|
pshilpar wrote: i need a application which we can pick a specific time and date..
And you want someone to write this for you??
BTW, I think you're actually asking about a component, not an application.
|
|
|
|
|
Good Morning All
Dave thanks for everything, am happy without a Wizard, i will never use a wizard again, and things are easier without it.i would like
UPDATE Clients SET Client_Name = @Client_Name, Contact_Person = @Contact_Person, Purchase_Date = @Purchase_Date, Client_Address = @Client_Address, Client_Telephone = @Client_Telephone, Client_Cell_No = @Client_Cell_No, SerialNummber = @SerialNummber, Product_Status = @Product_Status, Client_Email = @Client_Email
WHERE (Client_ID = @Original_Client_ID)
AND (Client_Address = @Original_Client_Address OR @Original_Client_Address IS NULL AND Client_Address IS NULL) AND (Client_Cell_No = @Original_Client_Cell_No OR @Original_Client_Cell_No IS NULL AND Client_Cell_No IS NULL) AND (Client_Email = @Original_Client_Email OR @Original_Client_Email IS NULL AND Client_Email IS NULL) AND (Client_Name = @Original_Client_Name OR @Original_Client_Name IS NULL AND Client_Name IS NULL) AND (Client_Telephone = @Original_Client_Telephone OR @Original_Client_Telephone IS NULL AND Client_Telephone IS NULL) AND (Contact_Person = @Original_Contact_Person OR @Original_Contact_Person IS NULL AND Contact_Person IS NULL) AND (Product_Status = @Original_Product_Status OR @Original_Product_Status IS NULL AND Product_Status IS NULL) AND (Purchase_Date = @Original_Purchase_Date) AND (SerialNummber = @Original_SerialNummber OR @Original_SerialNummber IS NULL AND SerialNummber IS NULL)
; SELECT Client_Name, Client_ID, Contact_Person, Purchase_Date, Client_Address, Client_Telephone, Client_Cell_No, SerialNummber, Product_Status, Client_Email FROM Clients
WHERE (Client_ID = @Client_ID)
I would like to be sure if am understanding this update statement very well. This SQl statement updates the Clients table on the above mentioned fields, for example the variable @Client_Name needs to be declared like this
cmd.Parameters.Add("@Client_Name", SqlDbType.VarChar, 50)
Am I right?
Ok lets Continue I understand the first 5 lines ,and I would like you to confirm with me for line 6.
WHERE (Client_ID = @Original_Client_ID)
Here we are making sure that a correct record gets affected by update. Client_ID is the Primary key of the table Clients. I want to understand the @Original_Client_ID, it’s the Original value before update happens ? please Explain for me that part and why is it needed.
Next here is another part that will help me understand the whole thing. The Following line after the where “And” was used.
AND (Client_Address = @Original_Client_Address OR @Original_Client_Address IS NULL AND Client_Address IS NULL)
Please Explain for me the above statement, exclude the one I asked for @original
And the last one is
; SELECT Client_Name, Client_ID, Contact_Person, Purchase_Date, Client_Address, Client_Telephone, Client_Cell_No, SerialNummber, Product_Status, Client_Email FROM Clients
WHERE (Client_ID = @Client_ID)
Why a “;” and a new select statement here, I suppose it separate the update statement and this only verifies the update?
Thanks for your help
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
|
|
|
|
|
First, when you post something in <pre> tags, make sure the text doesn't extend beyond the right edge of the screen. Go through and put in CR's at the points where text should wrap to the next line. It makes read your posts, an answering them much easier. Hit the Preview button to see what you're post is going to look like to us before you hit the Post Message button.
Vuyiswa wrote: for example the variable @Client_Name needs to be declared like this
cmd.Parameters.Add("@Client_Name", SqlDbType.VarChar, 50)
Am I right?
Partially. The length and type of the field you specify is determined by the length and type of the field in the table definition.
Vuyiswa wrote: WHERE (Client_ID = @Original_Client_ID)
... I want to understand the @Original_Client_ID, it’s the Original value before update happens ?
<blockquote class="FQ"><div class="FQA">Vuyiswa wrote:</div>The Following line after the where “And” was used.
AND (Client_Address = @Original_Client_Address OR @Original_Client_Address IS NULL AND Client_Address IS NULL)
Please Explain for me the above statement, exclude the one I asked for @original</blockquote>
Yep. All of these "Original value" parameters is to make sure that someone else didn't change the record while you were looking at it. If someone else changed the record between the time you fetched it, made changes to it, and the tried to write it back, a Concurrency Violation will occur. The SQL statement will return something like "0 rows affected" when your code was expecting 1 row. If it doesn't get back "1 row affected", then code knows that something in the record changed and you should give the user some kind of option to tell it what to do with the new changes since the changes someone else just made would normall be overwritten if you just specified the record ID alone in the WHERE clause.
Vuyiswa wrote: Why a “;” and a new select statement here, I suppose it separate the update statement and this only verifies the update?
It is seperate the UPDATE from the SELECT statement. The SELECT statement is there to return the new record back to the caller, not only to give the code the chance to verify the change was made, but to update the callers DataSet or DataTable.
|
|
|
|
|
Thanks Dave
i got it
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
|
|
|
|
|
hai all,
I need to know, is csv file format accept image.
if it is yes tell how can we do that in our vb.net form????
Thanks in Advance
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|