|
How do I link data bound detail fields on a form to data bound master fields? I'm using the default setup produced by dragging fields onto the form from the Data Sources window, so I have two BindingSource objects, one for detail and one for master. The two tables are linked by a relation in the DataSet.
|
|
|
|
|
Hello eveybody!
I have a small question need your help.
My datagridview is bound with a dataset contains tblProduct table. A combox allows users choose a Product(B3700, NAPPLE 3'1, NAPPLE 3'2,...)
If I filter like this tblProductBingdingSource.Filter = "Product = 'B3700'" . It works well
If I repeat tblProductBingdingSource.Filter = "Product = 'NAPPLE 3'2'" , it fails to work because of existence of the quote mark.
If I replace string "Product = 'NAPPLE 3'2'" with string "Product like 'NAPPLE 3%'" , my grid will have this list of unexpected products such as NAPPLE 3'1, NAPPEL 3'2, NAPPLE 3'3,so on.
When the users choose a value from combobox such as NAPPLE 3'2, I only have an only product, NAPPLE 3'2. Please help me correct the filtering string.
I know the filtering string "Product like 'NAPPLE 3%2'" but the string is not general for all.
Thanks in advance
Sorry about my English.
It seem to be a solution or an answer.
|
|
|
|
|
You can replace the single quote with two of them which means that it will work, so the search term would be
"Product='NAPPLE 3''2'''"
Give it a try and post back if you need any help
|
|
|
|
|
Hi
I have a text box with the following properties: Enabled=true,readonly=true.
The text box is only for reading and not for modify text.
i acomplish the above tasks but i cannot get read off the cursor in the text box.
if i use Enabled=false the cursor inside the textbox gone and cannot show in it, but the text
lose its forecolor which i can not accept it.
Please advice how i can make that cursor will not show at all in the text box
Or if we use Enabled property false how i not lossing the original forecolor of the font?
Thank in advance.
|
|
|
|
|
U can use Moucefocus propery to False.so than no mousce focus on that
textfiled..
|
|
|
|
|
Where does MouseFocus property occur mate?
|
|
|
|
|
RepliCrux wrote: Where does MouseFocus property occur mate?
It doesn't. See MSDN for a complete list of available properties[^]
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
how can i access this property.
Do you have a link or example that i can use?
Thanks
|
|
|
|
|
tomertro wrote: how can i access this property.
It doesn't exist. See MSDN for a complete list of available properties[^]
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thank you for your replay.
Tomer Trojman.
|
|
|
|
|
Catch the GotFocus event and focus another control
|
|
|
|
|
Very good idea, i try it and it's working good.
Thank you.
|
|
|
|
|
You are welcome
|
|
|
|
|
if you want to read it, you may also want to be able to copy (part of) its
contents, so having a cursor may be good.
|
|
|
|
|
thats right too, thank for your replay.
Tomer Trojman.
|
|
|
|
|
Hi All,
I am getting this error when I am adding user control in the form, Please me in solving this problem.
Thanks in advance.
|
|
|
|
|
In your user control there is a variable called emSize,
-- Either you are setting the value as 0 (and it should not be)
-- OR there is some calculation going on in the code, which is resulting the value of emSize to be 0 (which ofcourse should not be)
If that does not help, post it the usercontrol code.
Cheers.
|
|
|
|
|
No I have not use emSize variable anywhere.
The user controls is date control and code is:
Me.BackColor = g_FormBackColor
Dim obj As Object
For Each obj In Me.Controls
If TypeOf obj Is TextBox Then
obj.backcolor = g_TxtBackColor 'clrtxtbackcolor 'color.lightgray
obj.forecolor = g_TxtForeColor 'clrtxtforecolor 'color.blue
obj.font = New Font(g_strTxtFontName, g_intTxtFontSize, FontStyle.Regular) '"courier new"
'obj.borderstyle = borderstyle.fixedsingle
End If
If TypeOf obj Is Label Then
obj.font = New Font("", g_intLblFontSize, FontStyle.Bold)
End If
Next
My code is working fine if I comment this code.
Please help me...Thanks in advance...
|
|
|
|
|
Hi,
I did a quick search, looks like emSize has to do with System.Single, U are right.
don't know the exact reason why the code is falling over, but you can find a way out for sure.
may be 'obj.borderstyle = borderstyle.fixedsingle is the reason.
goodluck
|
|
|
|
|
Hi,
in your Font constructor the second parameter (your g_intTxtFontSize) specifies
the "emSize" of the font. Give it a reasonable value before instantiating a
font with it.
|
|
|
|
|
Hi,
I am creating a windows service that will process exe file( Developed in VB and connects to database using DSN and sa/master login).
When service process exe I am getting Database (Sql Server 2005) error "login failed to user sa.."
Code I am using:
Process p;
string FilePath = @"C:\vb_file.exe "; // vb_file connects to DB Sql Server 2005
string arg = " /send";
p = Process.Start(FilePath, arg);
Error I am getting...
The VB Application identified by the event source logged this Application vb_file: Thread ID: 5748 ,Logged:
vb_file Rev. 30-Apr-03T /send /RESTART
vb_file Rev. 30-Apr-03T /send /RESTART
Error 40002 in SQL.InputConnect: 28000: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'. [Aborted]
Please help...
Thanks
Taduri
|
|
|
|
|
hey can spread more light on ur proble,bcz i cant get it..r u write all code in Vb and from which language are u calling function
|
|
|
|
|
Don't use TxtSpeak. It makes your posts difficult to read. You've got a full 101+ keyboard in front of you, use it.
|
|
|
|
|
From the error message, it looks like your "vb_file.exe" used the wrong user name and password in its connection string to contact the database.
|
|
|
|
|
Thanks for reply...
Vb_file.exe is using correct username and password, it is using systemdsn to connect Database.
If I open start -> Run and type C:\vb_file.exe /send it is working fine and displaying GUI... and I checked in Event Viewer -> Application log it was not displaying any error.
same thing I am doing in Windows service written in C#..
My Intention is just display VB Application GUI through Windows Service...VB Application is connecting to DB using SystemDSN
Code I am written..
Process p;
string FilePath = @"C:\vb_file.exe ";
string arg = " /send";
p = Process.Start(FilePath, arg);
Service Interactiing with Desktop option is selected...
Once I started service and checked Event Viewer -> Application log ..it is showing below error...
Event Type: Error
Event Source: VBRuntime
Event Category: None
Event ID: 1
Date: 7/13/2007
Time: 9:33:41 AM
User: N/A
Computer: xxxx
Description:
The VB Application identified by the event source logged this Application vb_file: Thread ID: 2704 ,Logged:
vb_file Rev. 30-Apr-03T /send /RESTART
ODBC condition 18456, State=28000, RetCode=-1
28000: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'.
Please let me know if you need further info..
Thanks in advance
Taduri
|
|
|
|