|
Hello Frends, I am creating a client server aplication with Vb.net and sql server 2000, which reads and writes cliente information to database. I want to store the database connection string in aplication configuration file(App.config), so that when the aplication is compiled and installed at the client site, users can go to the aplication directory files and change the connection information based on the actual server name, etc.
so for application configuration file I did:
<appSettings>
< add key= "strConetionSQl" value=="Data Source=A2-02;AttachDbFilename=|DataDirectory|\Databases\interdit.mdf;Integrated Security=True;User Instance=True"/>
</appSettings>
and on the users form login button I used:
Dim strConetionSQl As String = ConfigurationSettings.AppSettings("strConexaoBD")
conn.ConnectionString = strConetionSQl
conn.Open()
so, when I debug the aplication I get this error from the strConetionSQl:
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll
Additional information: This is an unexpected token. The expected token is 'NAME'. Line 4, position 5.
|
|
|
|
|
You have a double equals (==) after the value in the config file. It should be a single equals.
|
|
|
|
|
I have finished writing an FTP application for my company. I am looking for the best way to deploy the application and provide updates. I have been looking at using ClickOnce deployment provided by Visual Studio. The problem that I am running into is that I don't like the fact that if you use ClickOnce you can not configure it to place an icon on the desktop and it does not create a program folder. I don't want to use MSI packages because it will be too complicated to get to all the needed users. The way I want it to work is that I can deploy the application to a web server and through some programmatic logic, have it check that server periodically for updates. If someone could point me in the right direction I would greatly appreciate it.
Thanks
|
|
|
|
|
Hi,
I have a form with a datagrid. The datagrid has a dataset as a source, and a TableStyle to make it all look good. The dataset gets manipulated in different ways, and the datagrid is refreshed between manipulations, to show changes to the user.
However, after the first manipulation / refresh the vertical scrollbar disappears, and I almost haven't got a clue why.
I use this public function in a module to do the refreshing, as there are several different forms in my app with their own datagrids:
<br />
Public Function refreshGrid(ByVal Grid As DataGrid, ByVal DS As DataSet, ByVal Member As String, ByVal frm As Form)<br />
Try<br />
DS.AcceptChanges()<br />
Grid.DataSource = DS<br />
Grid.DataMember = Member<br />
frm.Refresh()<br />
Catch Ex As Exception<br />
MsgBox(Ex.Message)<br />
End Try<br />
End Function<br />
As it doesn't throw errors, and it seems to actually refresh the datagrid, can anyone tell me whether I am making some mistake in my code, or whether the whole idea of a function for this operation is wrong, or any other possible reason for my Amazing Disappearing Scrollbar?
I Appreciate the help,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I wrote an AP that copy a user PST files to a network drive, it works fine, but the problem is, if I want to install it to every user's machine I have to change user profile path were the original data is located.
What I would like to do is for it to recognise the loged user, and once the user is ready just click on Start Button and start copying.
If anyone can Help I will be very greatfull.
This is a part of the code:
<'Copy all the PST files from Outlook directory
fileop.ClearSourceFiles
fileop.AddSourceFile "C:\Documents and Settings\USERNAME\Local Settings\Application Data\Microsoft\Outlook\*.pst"
'To a Network Drive
fileop.ClearDestFiles
fileop.AddDestFile "Z:\office xp"
'Copy the files
If Not fileop.CopyFiles Then
MsgBox "Not successfully completed."
Exit Sub
End If
MsgBox "Files copied Successfully", vbOKOnly
End >
-- modified at 8:11 Friday 9th February, 2007
|
|
|
|
|
Hi all,
Quick question, I am trying to save a data table to a excel work sheet, but I want to format it, so that it saves with nice borders and the text is aligned etc.
Could any one point me in the direction of this information. I know how to change the text etc, but not how to add borders, align text or anything else. I have included some code below for what I know how to do but I am lost on how to bring it further. - I have tried some obvious lines of code to try and get to text align functions but nothing works???
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
'Start a new workbook in Excel.
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add
'Add data to cells of the first worksheet in the new workbook.
oSheet = oBook.Worksheets(1)
With oExcel
.Range("A2").Resize(workTable.Columns.Count, workTable.Rows.Count + 1).Value = DataArray
.Columns("A:W").ColumnWidth = 18
.Rows("1:20").RowHeight = 15
.Rows("5").RowHeight = 30
.Columns.Wraptext = True
.Rows.Wraptext = True
With .Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.ColorIndex = 5
End With
End With
|
|
|
|
|
Hi all,
Quick question, I am trying to save a data table to a excel work sheet, but I want to format it, so that it saves with nice borders and the text is aligned etc.
Could any one point me in the direction of this information. I know how to change the text etc, but not how to add borders, align text or anything else. I have included some code below for what I know how to do but I am lost on how to bring it further. - I have tried some obvious lines of code to try and get to text align functions but nothing works???
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
'Start a new workbook in Excel.
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add
'Add data to cells of the first worksheet in the new workbook.
oSheet = oBook.Worksheets(1)
With oExcel
.Range("A2").Resize(workTable.Columns.Count, workTable.Rows.Count + 1).Value = DataArray
.Columns("A:W").ColumnWidth = 18
.Rows("1:20").RowHeight = 15
.Rows("5").RowHeight = 30
.Columns.Wraptext = True
.Rows.Wraptext = True
With .Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.ColorIndex = 5
End With
End With
|
|
|
|
|
hi all,
I want to create a timer programatically in VB.Net and need to activate
its Tick event. I have created the timer by using the following
statements:
Dim tmr As New System.Windows.Forms.Timer
tmr.Interval = 10000
How can I fire its Tick event? actually i want to perform a particular action in every 10 minuts.
any help will be appreciated...
thanks in advance
sebastian
|
|
|
|
|
Hi Sebastian,
Use withevents tmr As New System.Windows.Forms.Timer instead of dim, and the Class Name dropdown in the code window will offer you your tmr.
Start the timer (tmr.Start() ) use its Tick event to perform whatever code you need, and if necessary stop the timer (tmr.Stop() ).
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi
it worked
thank you so much
sebastian
|
|
|
|
|
Your welcome.
Enjoy,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
thnx
Ahmed El-Badry
|
|
|
|
|
Hallo,
i have combobox column in my datagridview in my vb.net(Winforms)
& i wnt to write code when user clicks on Combobox which is in datagridview.
Will u please tell me where to write code???
priya
|
|
|
|
|
Hi
I would like to place my application on top of all other application. is their any way i can do this???
Thank in advance
|
|
|
|
|
Set TopMost to true.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to send mail thru office outlook 2003 with vb.net 2003 with embeded images ,but mailitem.body will except a string only.I need ur help urgently.
I was once able to send a mail with embeded image using system.diagnostics.process namespace where I used body=nameofimagefile.
I lost that code and link and don't seem to recapture that.Thanks
Please help.
|
|
|
|
|
How do I capture a form's minimize or maximize event? I want to use these to minimize the form to the system tray instead of the taskbar. Will I have to override something?
"you can't forget something you never knew..." M. Du Toit
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
I use:
Private Sub fraMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
for the same purpose.
However when I activate my form again, it triggers the form's load event. (still working on that one)
My advice is free, and you may get what you paid for.
|
|
|
|
|
The Grids are a great way to display data, but I just noticed that sorting text columns poses a hiccup. Specifically, if I have three rows with IDs:
BB1, BB2 & BB10
Then the Grids sort them in the order
BB1
BB10
BB2.
This is particularly problematic in my case as I use the data in Grids to generate printed reports, & I want the data to be sorted in true alphanumeric sense. So, is there a way to achieve the desired affect???
|
|
|
|
|
what is the difference between shared ,public and public shared variables.if i declare a class as shared what is the advanvantage?
can anyone help me?.........
|
|
|
|
|
shared means it's visible to other classes within an assembly, but not outside it. If you have no code in dlls, this won't matter to you at all.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
saravanaks wrote: what is the difference between shared ,public and public shared variables
Shared is when the field, property or method is available to all instances of the class. (Equivalent of static in C#)
Public is when the field, property or method is available to code outside the class in which it is declared. In this case the item operates only on a single instance of the class.
Public Shared is a combination of Public and Shared.
saravanaks wrote: if i declare a class as shared what is the advanvantage?
It means you cannot have any instances of the class and all members must also be declared as Shared.
|
|
|
|
|
what is dll hell problem in .net
|
|
|
|
|
|
If you have these sort of broad questions, try google first.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|