|
|
Hi,
Jlawrnce wrote: strSQLEditCustomer = "UPDATE Customers SET ContactFirstName = ' " & txtFName.Text & " ' , ContactLastName = ' " & txtLName.Text & " ' , BillingAddress = ' " & txtAddress.Text & " ' , City = ' " & txtCity.Text & " ' , State = ' " & CboState.Text & " ' , PostalCode = ' " & CboZip.Text & " ' , PhoneNumber= ' " & txtPhone.Text & " ' , EmailAddress = ' " & txtEmailAddress.Text & " ' WHERE CustomerID = " & SearchCustID & " "
Use "Trim" method to supress the extra space
from the controls
like
"UPDATE Customers SET ContactFirstName = '"& Trim(txtFName.Text) &"'"
This will also help you.
Pankaj Kulkarni
|
|
|
|
|
Hi,
How to create Navigation Panel similar to the navigation panel seen in Microsoft® Outlook 2003, in vb.net.
waiting your answer.
|
|
|
|
|
|
|
Hello everybody,
how can convert date (in numbers) into the text format(string) in vb.net.
thank n take care.
bye...
|
|
|
|
|
You need to use the Date[^] type.
Dim myDate As New Date(myYear, myMonth, myDay)<br />
Dim myString As String = myDate.ToShortDateString()
|
|
|
|
|
.tostring?
example:
dim tDate as date= today
dim tDateStr as string = tDate.tostring
|
|
|
|
|
Hi all,
In a program developed in VB6 I've included a Datagrid. In the machine where I've developed the application all works fine but if I install the program (including and registering MSDATGRD.OCX) the program executes correctly except that the datagrid doesn't show the data and I've ensured that there are records in it.
Any ideas on how to solve it?
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hi all,
I've found the resolution right now. The item was that I needed to set the datasource of the datagrid when the form is loaded and not in the properties page pf the datagrid control. I don't knoow why (If anyone knows it, please, tell me) but in the developing machine the datagrid was populated and in the destination machine where VB6 is not there the datagrid was empty.
Marc.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I situation is I need to pull the data from an Excel Spreadsheet and Insert it into a SQL Server DB.
connecting excel via OleDb connection:
strExCN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FileName & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
which is connecting as it should.
I hope someone can lend a hand on this. I can open the excel file and begins to read but when I come across an empty file I get a dbNull error.
I have changed my select statement from
"select * from [worksheet$]" to
"select isnull(ColumnName, '') from [worksheet$]" and now am receiving and error saying
OleDbException was unhandled
Wrong number of arguments used with function in query expression 'IsNull('Column Name', '')'.
Any help on this error would be wonderful. Thanks in advance
culby sl
|
|
|
|
|
culbysl wrote: I can open the excel file and begins to read but when I come across an empty file I get a dbNull error.
When you come acrossed an empty Excel FILE?? Or Cell??
If it's an empty file, you can just capture the error in a Try/Catch block and move on:
' Setup connection stuff...
' Setup your loop, enumerating your files...
Try
' Open the connection
' Execute the SELECT statement
Catch ex As Exception
' Handle the emtpy file problem here...
Finally
If connection is not closed then
Close connection
End Try
' Loop around to process the next file...
culbysl wrote: Wrong number of arguments used with function in query expression 'IsNull('Column Name', '')'.
You can't use Excel functions in the SELECT statement because Excel is not doing the processing here. You should either stick with the * or specify the columns you're actually goint to use.
Now, if your code is bombing try to use a DBNull value from a cell, then your code has to check to see if that value is DBNull before trying to use it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Anyone knows how to generate PDF File using VB.net?
Thanks
|
|
|
|
|
1) you can buy a 3rd party package which allows you to create reports
2) you can use ReportDocument from .Net BCL and the "report viewer" has the option to export it into PDF/Excel/Word etc.
3) Install PDF driver on the client machines first (Free PDF print driver (no ads/spyware)[^]. Create PrintDocument and perform your custom drawing. Print to this printer.
- Malhar
|
|
|
|
|
thank you
|
|
|
|
|
|
|
ICustomFormatter lets you define entirely custom formatter for your object. You don't have to impement or specify which standard formatting codes, like G or N, that your formatter supports because you're providing the ENTIRE formatting implementation yourself, including parsing custom formatting commands in the format string (object.ToString("customFormattingCodes"). You're extending the standard set of codes with your own.
The IFormattable interface says that you're not extending the existing set of foratting codes, but just providing custom implementations for the standard set of codes, with respect to the current culture. At a minimum, your code must support the standard formatting code "G", or General format. You can supply custom formatters for any and all of the standard formats.
For example, consider the "C", Currency format. There is a standard implementation for a floating point number and returns a string representation of the number, formatted to what is specified in the current culture. You could implement your own, similar functionality on any of your own custom objects, even those that don't directly represent a number. Your custom formatter for Currency would respond to the standard format string "C", like this: myCustomObject.ToString("C") .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how i can display image on a menu???
|
|
|
|
|
I'll not help you on this because I know you can do it yourself. Simply google it. CP also has great articles on this.
- Malhar
|
|
|
|
|
hi everyone,
I would need to get access to third party snapins in MMC so I can read information from these MMC snapins and store this information somewhere else into a text file. I don't need to modify this information, I only need to retrieve it, so I don't need to work with MMC manually in GUI form but can create reports in text file form from these MMC snapins. Do you have any idea if there is a way how to get this information from 3rd party snapins programatically (if possible in a consistent way) ?
thanks & regards.
krompo
|
|
|
|
|
Hey all,
First, we are talking here about windows forms, and dotnet 1.1.
I've created a custom usercontrol that's some kind of progressbar, but special suited for my goal. It uses textless labels as shapes. I want to embed this control in a datagrid, for every row it has to show a value and it is thus always visible, not only in edit mode (it has no edit mode; it's purpose is to show a progress).
I found some samples of custom columns, but the one inherits datagridtextboxcolumn and shows the control only in edit mode and creates only one instance of the control, and I don't get how to create an instance for every row.
The 2nd sample doesn't use a control, but just paints something on the cell, it doesn't use controls. This example inherits the DataGridColumnStyle.
And the last example also inherits the DatagridTextboxColumn but they retrieve values from a database from within the custom class, you can't pass a datasource to it, and I want it to be a general useable column.
Does anybody know how to do this? Make a custom datagrid column, that shows a user control in every row, and the value passed to the control is row dependant?
Greetz
JT
|
|
|
|
|
Hi,
Is there any code sample to add application to Windows scheduler, so that it can automatically run application at scheduled time.
Thanks in advance.
Be simple and Be sample.
|
|
|
|
|
Rather than use the Windows Task Scheduler, why don't you write your own service and have your application executed from there?
Tim
|
|
|
|
|
I couldn't find any VB.NET specific examples, but you could probably put one together using the examples found here[^]. Specifically, look at the Scripting versions of the examples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|