Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie - Need help finding where a text box value is coming from 1

Status
Not open for further replies.

Gzk2010

Programmer
Aug 17, 2010
48
US
Need help finding where a text box value is coming from.

I tried to find on the text box name but it does not seem anywhere in code to be assigning anything to it. Like I am looking for txtSPath.text = @"\path\etc"

The path in this text box changes on clicking a row in a DataGridView control. Would that be an on selection_change event or what. I could not see it on selection change anywhere either.
Really another way to find when it is puting the wrong path in the text box is to add a watch to the txt.text value. Is this possible? I know you can set watches for variables But to catch when a textbox.text value changes?

Thanks in advance
 
it's hard to say without seeing the code. if the text box value changes when a new row is selected from the datagrid this would be the place to start looking.

how are you searching the code? through VS IDE wizards/gui menus and tool bars, or through searching the source code? I would open up the source code and begin browsing.

what types of abstractions or 3rd party frameworks are used. Are partial classes being used?

another approach, search the code for the name of the object "txtSPath" and start tracing how it's being using. there may not be a direct call to txtSPath.Text = value; it could be abstracted/encapsulated within another object.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Ok, I should have known it is databound and getting the file path from sql server. but as a newbie, I still do not get it cause here is the path in the column from the database, what does the $E mean.
is $ in c# mean hidden or is does this probably mean environmental variable path?

here is the column the txtSFilePath is bound to in an sql server table:
\\SAHQSQL01\E$\DataRapRAF\SubmissionsV2\PHC\12\WCMZ262.UP5G.RAPS.A.H6120.FUTURE.P


SO it is binding to this but what do you think E$ does upon databinding in c#

working in a winforms app VS 2010 using no third party platforms

thanks in advance
 
E$ has nothing to do with C#, it's just part of the string. the string happens to be a file path.

if a directory is not publicly shared you can still use the UNC
[tt]\\server\[drive letter]$\path\to\directory[/tt] to access the remote directory. I think this feature is enabled by default on Windows. However it can be disabled, so you cannot guarantee it will work.

typically however the network will have public shares. for example [tt]H:\Foo\Bar[/tt] may map to the physical location [tt]\\myserver\c$\program files\my program[/tt].

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
thanks so much. I had to switch the programs test environment to DEV environment. atleast now I have an environment where testing works. and that clears it up E is the drive and $ means to use UNC path.
Thanks so much. I have got to learn this program and get the changes fixed by monday afternoon latest and I think the stress is clouding my confidence in understanding it all.

Its just to much to learn what everyline of code is doing, for now just enough to fix and make the needed changes. SSUUPPEERR thanks.

Now everytime I run it I have to figure how to back the data out of the sql tables so it thinks it has not run, so I can rerun it. joy.
But little at a time I am getting a little step closer thanks to you alls help!
 
Now everytime I run it I have to figure how to back the data out of the sql tables so it thinks it has not run
I find recreating the schema is the simplest thing. it's brute force method of testing, but it does come in handy in cases like this.

another option is to use System.Transaction without call Complete. this will all you to test the sql commands. not call Complete signals the transaction to rollback.

finally, if your working with an ORM or abstracting the database an in-memory SqLite database is also good for testing. the difference between sqlite and sql server are great enough that I would only use this for small, quick, unit test. If you want to run a suite of integration tests then one of the first 2 options will be a better choice.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
I figure out the backout sequence to the 3 sql tables, 1 has a set cascade with PK FK relationship. SI I just delete 1 row in table 1 and allow the rows for table 2 that are associated are deleted. Then since the 3rd has a PK to FK to table 2, it will not cascade since it would be deleting uphill or from table 2's FK to table 3's PK. Allow there is an explicit cascade delete set on that as well.
SO the 3rd I do a little t-sql to get the bottom 1 of table 3:

select * from
tblSubmissions where
submissionID not in
( select top
(
(select count(*) from tblSubmissions) - 1 )
submissionID from tblSubmissions )



, then I have the the user and datetime and can delete table 3
based on that criteria. I would like to set a trigger to automate this logic but it would have to go through our company's change release process and so not worth it.


As for your suggestion, I will try that next time. That would be sweet to not have to back out at all if it calls it back!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top