|
what is vb.net code for changing the values in datagrid and save the changed values in datagrid in vb.net windows application
|
|
|
|
|
hi
I dont know that,this is the right forum to ask this question
i am developing a sample aplication in EXcel, i just placed button i got the click event how can i retrive values from the cell to VB
My small attempt...
|
|
|
|
|
sujithkumarsl wrote: hi
I dont know that,this is the right forum to ask this question
i am developing a sample aplication in EXcel, i just placed button i got the click event how can i retrive values from the cell to VB
My small attempt...
in excel right click on button , select assign macro...
create new macro->edit or view code (as per your office version)
and write vb code
|
|
|
|
|
Hi,
How do i run win32 api in a vb.net program, i declared shell execute function and tried to call it from my form. but it says unmanaged call is trying to run from managed code and something about PInvoke too.
please advice me
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
Process.Start will do that for you. In general, www.pinvoke.net is the place to find out how to call Win32 APIs
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
the .net framework base class Imports System.Runtime.InteropServices will be remedy of this problem?????
|
|
|
|
|
Saying ShellExecute 0&,"Open",filepath,0&,0&,3 is what i want to execute. how can i do it with Process.Start ?
can you show me an example?
Thanks for your advice
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
If you want to call a specific function.. u can call as
<br />
[DllImport("USER32.DLL")]<br />
public static extern int SendMessage(int hwnd, int msg, int character, String text);<br />
<br />
"If our Mind can, the Program can !!" ≡ ░Ŗǿђầŋ٭ ≡
|
|
|
|
|
I am writting software for my company in which the program needs to generate an Excel file without using excel. I've figured that part out by using the XML format for excel. However, I was wondering if there was a way to pring the files (preferrably sheet by sheet) without having excel installed? Or is there a way to convert the XLS files into a PDF? Any help in the right direction would be appreciated.
|
|
|
|
|
AFAIK, all the ways to read or work with an XLS files require Excel installed
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I was trying to install the setup of my program(VB.net 2005) on the machine which does not have the dotnet framework.
I have added the .net framework by right clicking the setup project- which is included in the project.
Add\assembly\browse\c:\installer-6171-19-Microsoft-NET-Framework-2-0-50727-English
then built it.
still getting the same problem .
u need to install the .net framework 2.0.50727
|
|
|
|
|
don't just add framework into your project, right click on setup project, select properties, click prerequisites and tick .net framework 2.0 and select install from the same location as my application option too. now build your project
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
i am doing the same thing now...... what u told .
adding the dotnet framework ...the following file.
should i just add it to the setup or i have to place it some where else as well.In order to run the setup successfully.because i am still getting the same problem.
I have checked the link as well
Download prerequisit from the same location as my application.
installer-6171-19-Microsoft-NET-Framework-2-0-50727-English
|
|
|
|
|
after building the setup project make sure you have .net framework redistributable in a folder inside your setup's release folder. if it is there then you are doing right. when you double click setup it will say the following prerequisites are not installed in your computer and will install when you press ok. thats the right way.
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
when you added your project output (the exe file from your program) visual studio will automatically add .net framework to your detected dependencies folder in solution explorer. make sure it detects correct.
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
When i am adding the project output , it does not confirm the .net framework dependency.I have already placed the .net framework exe into the debug and release folder.Still i am getting the sae problem.
Even i am using the two exe's
dotnetfx.exe
installer-6171-19-Microsoft-NET-Framework-2-0-50727-English.exe
|
|
|
|
|
How should I add an exe into my active project , When the same is demanding a COM component.
I mean can i add an exe into my active project????????????????
|
|
|
|
|
when you create setup project first open the project you need to create setup for. then from file add new project and then other project types and setup project. give the name setup and select add to current solution (you should not create a new solution). when setup project is loaded, on filesystem editor right click application folder and select add -> project output and select primary project output.
this will detect dot net version and prerequisites automatically. now you won't have to select dot net manually
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
How visual studio will automatically add .net framework to detected dependencies folder in solution explorer.
I have - in the prerequisite - checked the download prerequisites from the same location as my application.
I can't add the exe into the active project.because it is the COM component , dll not the exe which gets added into the references
Now what i have to do in addition to these to make the visual studio automatically add .net framework to detected dependencies folder in solution explorer
|
|
|
|
|
so you are using a .net setup project for deploying a non .net project ?
i didn't understand. don't you have a sing exe or dll created in .net 2.0 in your project ?
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
Hi.......
Is there any article that describes the setup wizard fo the following
Especially the View/Editor/User Interface , registry , file type , custom action , user interface , launch condition.
|
|
|
|
|
Hi,
I have to do updates to my mdb access database, which has 2 column, user_name and user_pwd.
I have followed the suggestion from MSDN, but I don't know it still got error when excuting update().It says "Update command" or "Insert Command" to have connection object...
Can someone give me some hints or point out to me that What I missed?
Here is my code:
<br />
Dim connStr As String = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\me.mdb")<br />
Dim sqlStr As String = "SELECT * FROM wpLogin"<br />
Dim dt As New DataTable()<br />
Dim dataAdapter As OleDbDataAdapter<br />
Dim ODBconn As OleDbConnection<br />
<br />
<br />
Public Function CreateDataAdapter(ByVal selectCommand As String, ByVal connection As OleDbConnection) As OleDbDataAdapter<br />
<br />
<pre>Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(selectCommand, connection)<br />
<br />
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey<br />
<br />
' Create the commands.<br />
adapter.InsertCommand = New OleDbCommand( _<br />
"INSERT INTO wpLogin (user_name, user_pwd) " & _<br />
"VALUES (?, ?)")<br />
<br />
adapter.UpdateCommand = New OleDbCommand( _<br />
"UPDATE wpLogin SET user_name = ?, user_pwd = ? " & _<br />
"WHERE user_name = ?")<br />
<br />
adapter.DeleteCommand = New OleDbCommand("DELETE FROM wpLogin WHERE user_name = ?")<br />
<br />
' Create the parameters.<br />
adapter.InsertCommand.Parameters.Add( _<br />
"@user_name", OleDbType.Char, 50, "user_name")<br />
adapter.InsertCommand.Parameters.Add( _<br />
"@user_pwd", OleDbType.Char, 50, "user_pwd")<br />
<br />
adapter.UpdateCommand.Parameters.Add( _<br />
"@user_name", OleDbType.Char, 50, "user_name")<br />
adapter.UpdateCommand.Parameters.Add( _<br />
"@user_pwd", OleDbType.Char, 50, "user_pwd")<br />
<br />
adapter.DeleteCommand.Parameters.Add( _<br />
"@user_name", OleDbType.Char, 50, "user_name").SourceVersion = _<br />
DataRowVersion.Original<br />
<br />
Return adapter<br />
</pre>End Function<br />
<br />
<br />
Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click<br />
<pre>'Displays the table's data in the data grid<br />
'Clear the current contents of the table<br />
dt.Clear()<br />
'Fill the data table with data from the database<br />
'Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)<br />
ODBconn = New OleDbConnection(connStr)<br />
dataAdapter = CreateDataAdapter(sqlStr, ODBconn)<br />
dataAdapter.Fill(dt)<br />
'dataAdapter.Dispose()<br />
'Display the table in the data grid<br />
dgDisplay.DataSource = dt</pre><br />
End Sub<br />
<br />
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click<br />
'Save the tables's changes back to the database<br />
<pre>Dim changes As Integer<br />
<br />
<br />
'Update the database with changes from the data table<br />
changes = dataAdapter.Update(dt)<br />
'dataAdapter.Dispose()<br />
'Display the number of changes made<br />
If changes > 0 Then<br />
MsgBox(CStr(changes) & " changed rows were stored in the database.")<br />
Else<br />
MsgBox("No changes made.")<br />
End If</pre> <br />
End Sub<br />
<br />
Private Sub UserManager_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing<br />
<pre>dataAdapter.Dispose()</pre><br />
End Sub<br />
End Class<br />
-- modified at 23:08 Friday 11th May, 2007
|
|
|
|
|
I have frame and listview1. I want to hide the frame when i click(left click or right click) on white area of listview1 where is there is no data (As shown in attched pic).could any one show me how this can be done?Thanks
<br />
Private Sub ListView1_Click()<br />
gstrSomething = ListView1.SelectedItem.SubItems(4)<br />
gstrSomethingElse = ListView1.SelectedItem.Text<br />
Frame1.Visible = True<br />
<br />
End Sub<br />
<br />
<br />
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)<br />
<br />
Dim lvwItem As ListItem<br />
If Button = vbRightButton Then<br />
Set lvwItem = ListView1.HitTest(x, y)<br />
If Not lvwItem Is Nothing Then<br />
<br />
Frame1.Visible = True<br />
<br />
lvwItem.Selected = True<br />
PopupMenu mnuEdit<br />
Else<br />
Frame1.Visible = False<br />
End If<br />
End If<br />
<br />
<br />
End Sub<br />
<br />
|
|
|
|
|
have my program working but need to be able to search for files of multiple file types and search for multiple drives at the same time. Right now I can only search for one files type by typing the extension into a textbox. To search for the drive, i created a BrowseFolderDialog to search folder on a specific drive and the path is displayed in a textbox. So I have two question: Is there a way for me to search for multiple file types by typing the extensions in the textbox at the same time? Is there a way to search for more than one drive in a text box at one time?
Here is some code:
Private Sub GetDirectoryContents()
Dim FilePattern As String = "*." & TextBox2.Text.Trim
Dim sdir As String = TextBox1.Text.Trim
Dim dDir As New DirectoryInfo(sdir)
Dim fi As FileSystemInfo
For Each fi In dDir.GetFileSystemInfos(FilePattern)
ListBox1.Items.Add(fi.Name)
Next
End Sub
This is the class I created to search for the folders:
Dim MyBrowseFolder As New FolderBrowser()
Public Function ShowDialog(ByVal browseFolderTitle As String)
With MyBrowseFolder
.Style = FolderBrowserStyles.BrowseForComputer
.StartLocation = FolderBrowserFolder.MyComputer & .StartLocation = FolderBrowserFolder.MyDocuments
'Dialog box title
.Description = browseFolderTitle
.ShowDialog()
'Return the folder path.
ShowDialog = .DirectoryPath
jds1207
|
|
|
|
|
let the users type multiple extensions to a textbox seperated by commas. create a thread to search a specific extension in your path and then run multiple instances of that thread with one extension in each thread. since you have the code convert the function you are using to a thread
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|