|
It isn't very clear what you're having a problem with. Are you saying that you're trying to retrieve records from the database using the date in the DatePicker control?
Or, are you saying that the date you get from the database isn't being bound to the DatePicker control properly?? If so, what does you're code look like that does the binding to the DatePicker? Are you binding to the DatePicker's SelectedDate property?? You should be!
|
|
|
|
|
Hi everybody
I am working on app in vb 2008 and have following situation:
I have one form with datagridview binded to access table with dataset, bindingsource, tableadapter and tablemanager. User cannot change, delete or add records in datagridview.
On same form I have two buttons for editing and adding new records
When user clicks on "edit" button another form is opened and on this form detailed information is displayed (based on row selected in datagridview) so user can edit and save data. On second form there are several txt boxes binded to same table through another dataset filtered on current record with following code: frmPD.TblPartnersBindingSource.Filter = "CompanyID =" & TblPartnersDataGridView.CurrentRow.Cells(0).Value.ToString
My quiestions are:
1. Is this correct way to open "details" form (using filter property of bindingsource)
2. How to use same "details" form to add new record.
Sincerely
Ivan
|
|
|
|
|
hello
there is an idea that you could use your textboxes at same form(let me say top)
when you navigate between records,your detaild information will be shown in text boxes to the user.
you can use TblPartnersBindingSource.addnew to insert a new record to database.
modified 17-Jun-12 7:33am.
|
|
|
|
|
Dear all,
I am testing out a command line program written in VB.NET. Of course the first line would check if the number of parameters is right. I use
Dim inputArg() As String = System.Environment.GetCommandLineArgs()
I find out the GetCommandLineArgs() fails if the input directory name is long! If I have input as:
"C:\abc123\456780\" "C:\long long long space\" "abc=def, 123=456, 81\23 33" , I would get: inputArg(1) | "c:\abc123\456780" c:\long" | inputArg(2) | "long" | inputArg(3) | "long" | inputArg(4) | "space" | inputArg(5) | "abc=def, 123=456, 81\23 33" |
Beside using a shorter path, any idea?
|
|
|
|
|
I'm assuming that the quotation marks are all part of the input in which case you're confusing the heck out of the parser! As I understand it, the input you need is ..
C:\abc123\456780\ "C:\long long long space\\\" "abc=def, 123=456, 81\23 33"
if the long directory name includes spaces else
C:\abc123\456780\ C:\longlonglongnospaces\ "abc=def, 123=456, 81\23 33"
See MS help ....
Quote: Command line arguments are delimited by spaces. You can use double quotation marks (") to include spaces within an argument. The single quotation mark ('), however, does not provide this functionality.
If a double quotation mark follows two or an even number of backslashes, each proceeding backslash pair is replaced with one backslash and the double quotation mark is removed. If a double quotation mark follows an odd number of backslashes, including just one, each preceding pair is replaced with one backslash and the remaining backslash is removed; however, in this case the double quotation mark is not removed.
|
|
|
|
|
biop.codeproject wrote: Beside using a shorter path, any idea?
- That's not even close to "long"
- What does "fail" mean? If you report a "fail", please state whether it throws an exception, does not work as expected, or whether your computer simply died.
- What's wrong with the results that you list at the end of your post? These are the args that I would expect.
Bastard Programmer from Hell
|
|
|
|
|
Cool man! I love your reply. It really challenges me to be more careful next time when I post my question. I should clearly state what my input should be. I guess right now you should figure out I want to have three parameters. First one is a directory name. Second one is also a directory name. The last one is a special string.
|
|
|
|
|
|
It's not the quotes that are screwing it up, it's the backslashes. You don't normally see directory paths specified with a trailing backslash. You can put any filepath you want inside double quotes, even if there are no spaces in the path.
|
|
|
|
|
Thanks. Finally someone can help out.
|
|
|
|
|
A single backlash in front of a quote character makes the parser treat that character as part of the string rather than a separator.
|
|
|
|
|
Thanks. Finally someone can help out.
|
|
|
|
|
hey friends,i have a problem about my program...
i have just make a simple web browser,but i think it is very simple...
can you tell me an opinion about advanced browser features?
|
|
|
|
|
You might want to describe what kind of opinion you're looking for and define what you think is an "advanced browser feature".
BTW, dropping the WebBrowser control on a form is not making your own "simple browser". All you're doing is embedding Internet Explorer into your app. You haven't actually "made a browser".
|
|
|
|
|
I have been using VS2008 on XP for some time now, converting a project to VB.net. I have it largely converted and am debugging now (i.e. the project is running fine)
I am trying to move it to Windows 7 (finally). I installed the exact same visual studio I am using on XP, and I copied the project directory from the old computer to the new computer.
For some reason I loose a few references so on the reference page I add them back in, there were three of them, all custom references. The reference dialogue tells me it can not find the files specified, on the XP machine they are listed as being in \project\obj\release directory, so on the Windows 7 machine I point to them there (not sure if I should do that or point to the original)
When I try to run or debug the project I get the following errors and it stops.
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in MBIG.exe
A first chance exception of type 'System.TypeInitializationException' occurred in MBIG.exe
A first chance exception of type 'System.TypeInitializationException' occurred in MBIG.exe
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in MBIG.exe
The program '[2776] MBIG.vshost.exe: Managed' has exited with code 0 (0x0).
Anyone have any suggestions as to what I should do to resolve or identify the problems? (not sure it the references impact this or not)
no-e
|
|
|
|
|
Add those .DLL's projects to this one and you can add a project reference instead of a file reference. That way, the .DLL projects will be recompiled (if needed) and any changes automatically propogate through to your application without screwing up the references.
You will also have to go back to those .DLL's projects and make sure they compile and work as intended. They might have dependencies that have changed on Windows 7 or on projects you have no copied over.
Judging by the error messages you posted, the .DLL's you're referencing may need to be registered on the machine, i.e: REGSVR32.
|
|
|
|
|
Dave,
Thanks for the response, that appears to have put me in the right direction. I registered them, deleted interop.XXX files in question, added references to the proper dll files and it worked for two, it appears that it creates the interop.xxx files in the \obj\debug and \obj\release directories... at least for two of them.
When I debug, it tells me it cant find the "interop.xxx3" file. If I look at references it lists the original DLL file for the one it can't find (the other two changed to indicate the interop.XXX and interop.xxx2
Can you give me a bit of guidance on how this is supposed to work? I could not find much in the way of background on the web. Is there a way to force it to create these files?
no-e
|
|
|
|
|
Not sure about the full answer but when moving projects in this way you should only move the directories containing source code, and rebuild everything from scratch in the new location. Try doing a clean of your project, delete all obj and bin directory trees, reset all references to ensure they point to the correct DLLs on the new machine, check your project dependencies (if any), and then try building the project(s) again.
|
|
|
|
|
Hi all
I have a two Input data of Year and Name in separate two arrays. I need to sort both the array values first i need to sort it chronologically(Year) and then if year information repeats it will sort the Array Alphabetically.
As for as i complete the sorting for both year and then name. Using Wordbasic.sortarray command
Input: (Before sorting)
SDF 1997
ELS 1986
PJK 1983
WKL 1995
EFD 1986
Output: (After sorting)
PJK 1983
EFD 1986
ELS 1986
WKL 1995
SDF 1997
if i print it in word it printed like this:
PJK 1983, ELS 1986, EFD 1986, WKL 1995, SDF 1997.
Here is my code for Printing the data. Would anyone please look into this and guide me where did i made mistake?
WordBasic.sortarray SortyearArray()
Dim I As Integer
Dim J As Integer
Dim K As Integer
Dim N As Integer
Dim Counter As Integer '
COUNTER1 = 1
i1 = 1
J1 = 5
For I = 0 To UBound(SortyearArray())
Counter = 1
For J = I + 1 To UBound(SortyearArray())
If SortyearArray(I) = SortyearArray(J) Then
Counter = Counter + 1
MsgBox (Counter)
End If
COUNTER1 = Counter + COUNTER1
Next J
If Counter = 1 Then
For N = i1 To J1
If SortyearArray(I) = Year(N) Then
Selection.TypeText Text:="(" & AuthorName(N) & Year(N) & ")"
End If
Next N
End If
Next I
Anyone please guide me to complete this.
Dk.G
|
|
|
|
|
godevg wrote: Selection.TypeText Text:="(" & AuthorName(N) & Year(N) & ")"
Looks like you are missing a linefeed somewhere?
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
is it possible to limit picturebox picture size?
i've searched all day in google, they're all limitation in width and height, the size limit i mean is like 500KB or 1MB.
|
|
|
|
|
Pictures can't be limited in file-size by loading them; you can't load half a picture and decide that you had enough, since it would be only half-a-picture.
Load the image, resize it (width and height), reduce colors, save it in a different format; those are ways to reduce the file-size.
Bastard Programmer from Hell
|
|
|
|
|
When I am scrolling datagrid after selecting one row I am getting error as "An unhandled exception of type System.StackOverflowException occurred in System.Windows.Forms.dll" on line :
MyBase.Edit(source, rowNum, bounds, [readOnly], instantText, cellIsVisible)
Whole code is given below :
' Hosts a TextBox control in a cell of a DataGridColumnStyle for editing strings.
'
' Note:
' Adds the ability to change the color of an individual cell. As each row in the column is
' painted an event is fired that allows the setting of the new color.
' Added returning the cell value when it's being painted. Also if the row is selected the
' selection colors will be used.
'-----------------------------------------------------------------------------------------------'
' Additional namespaces.
Imports System.Windows.Forms
Imports System.Drawing
Public Class FormatableCellDataGridTextBoxColumn
' Base class.
Inherits DataGridTextBoxColumn
' Delegates.
Public Delegate Sub PaintingCellEventHandler( _
ByVal sender As Object, _
ByVal e As PaintingCellEventArgs)
Public Delegate Sub EditingCellEventHandler( _
ByVal sender As Object, _
ByVal e As EditingCellEventArgs)
' Events.
Public Event PaintingCell As PaintingCellEventHandler
Public Event EditingCell As EditingCellEventHandler
' Instance variables.
Private _columnNum As Integer
Public Sub New(ByVal columnNum As Integer)
' Initialize instance variables.
_columnNum = columnNum
End Sub
Protected Overloads Overrides Sub Paint( _
ByVal g As System.Drawing.Graphics, _
ByVal bounds As System.Drawing.Rectangle, _
ByVal source As System.Windows.Forms.CurrencyManager, _
ByVal rowNum As Integer, _
ByVal backBrush As System.Drawing.Brush, _
ByVal foreBrush As System.Drawing.Brush, _
ByVal alignToRight As Boolean)
' Local variables.
Dim foreColor As Color
Dim backColor As Color
Dim rowIsSelected As Boolean = False
Dim text As String = NullText
Dim value As Object = GetColumnValueAtRow(source, rowNum)
Dim arg As PaintingCellEventArgs
' Determine if the row is selected.
If TypeOf foreBrush Is SolidBrush AndAlso TypeOf backBrush Is SolidBrush Then
foreColor = DirectCast(foreBrush, SolidBrush).Color
backColor = DirectCast(backBrush, SolidBrush).Color
If _
foreColor.Equals(DataGridTableStyle.SelectionForeColor) AndAlso _
backColor.Equals(DataGridTableStyle.SelectionBackColor) Then
rowIsSelected = True
End If
End If
' Retrieve brushes.
If Not IsDBNull(value) Then text = value.ToString()
arg = New PaintingCellEventArgs( _
rowNum, _
_columnNum, _
text, _
backBrush, _
foreBrush)
If Not rowIsSelected Then RaiseEvent PaintingCell(Me, arg)
' Paint the cell.
MyBase.Paint(g, bounds, source, rowNum, arg.BackBrush, arg.ForeBrush, alignToRight)
End Sub
Protected Overloads Overrides Sub Edit( _
ByVal source As System.Windows.Forms.CurrencyManager, _
ByVal rowNum As Integer, _
ByVal bounds As System.Drawing.Rectangle, _
ByVal [readOnly] As Boolean, _
ByVal instantText As String, _
ByVal cellIsVisible As Boolean)
' Local variables.
Dim editBoxIsToBeHidden As Boolean = False
Dim e As New EditingCellEventArgs(rowNum, _columnNum, editBoxIsToBeHidden)
' Retrieve edit instructions.
RaiseEvent EditingCell(Me, e)
' Allow the call to progress normally.
MyBase.Edit( _
source, _
rowNum, _
bounds, _
[readOnly], _
instantText, _
cellIsVisible)
' Hide the edit box.
If e.EditBoxIsToBeHidden Then
Me.HideEditBox()
End If
End Sub
End Class
|
|
|
|
|
First, if you're going to post code put it inside PRE tags so it's retains it's formatting and is readable.
Second, there are no definitions for PaintingCellEventArgs and EditingCellEventArgs, so we have no idea how you're getting values from the client code.
We also have no idea what the client code looks like that is filling it these values.
...and I can't quite put my finger on it, but as it stands, this code looks a bit ... funky.
|
|
|
|
|
I'm just stuck here ...
Given:
Dim i As Integer = 1
Debug.Print(i.ToString("000"))
What I can't seem to figure out is the correct format string to be used with .ToString to give me two spaces then the number 1. (which would be right aligned)
|
|
|
|
|