|
Hi all,
I have to develop a project, which will have ListView control along with expand and minimize button features. In other words, I need to attach 5 tables in single form which will show only header when clicked on the header, expanded table to be shown. can anyone help me to achieve this.
I am using arrays as input data to tables
|
|
|
|
|
2 controls and an image button.
1 Textbox/label to hold the table name and info
Listview (I like listviews) with a height of 0
When the use clicks the image button, change the image and expand the height of the listview.
Experiment with a user control (all 3 controls in a panel) stick the UC inside a flowcontrol and it may manage the control actions when you expand/contract the listview. Remember if you use a UC put the management in th code behind the UC.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
ask u guys..i need to differentiate the codes between color of maps in day and night..in vb 2008
|
|
|
|
|
What are you asking for ? To color maps where, and based on what ? You want to draw what regions are night and which are day ? Just draw a semi transparent black box over the night part of your map.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hy everyone!
i am looking for good ideas. what i want to do is to realize a file/directorywatcher, which handles xml files and when it is done it places a "finished" file into this directory to indicate the file was handled.
example: i do have 5 directories (a, b, c, d and e) which contain different xml files. only one in each folder. when my program has handled a file in one folder, it places a "finished" file in there. sounds easy
well my problem is, i found out if it takes to long to handle a file and the other proggy (which creates the xml files) finds a "finished" file, then it starts to consume these files and folders. this means when one "finished" file is found then it deletes all folders one by one. and if my program isn't quick enough, files are lost.
that's why i tried to figure out a different solution to this problem. i have to add the "finished" files to the directories after having handled tue last xml file, which was found.
well therefore i have to remember the directories, i parsed before.
i thought about using a string similar to csv e.g. "dir1;dir2;...", split it afterwards and add the file. or to create an array adding one element after each other. but both solutions could become very timeconsuming. the bigger the string will get, the longer it will take to rewrite it (no idea if there is a function like stringbuilder in c#). and rewriting an array to add an element isn't nice neither.
does anyone of you have a good idea how to handle it? i also thought about creating a temp "finished" file and rename it afterwards, but i will have to remeber the directories as well to do so.
so to summarize the situation is like this:
1) read xml files from different directories and handle them (one by one - read one dir, handle xml file, next dir etc.)
2) when all xml files are handled which where found in the directories, then write a "finished" file in each directory to indicate the operation was finished
3) start at 1) again whit the next files
it's allowed to have
dirA finished
dirB finished
....
dirZ finished
but it's not allowed to have
dirA finished
dirB finished
.....
dirX file.xml
dirZ file.xml
my old solutions was quite easy: reading the file and write a "finished" file to this directory, then continue with the next one etc. with this solution no storage of directories was needed, but this didn't work properly enough
thanks for any good ideas!
stephan.
|
|
|
|
|
We had a similar problem using a "hot" folder, the enterprise ETL tool would write the files and out local tool (custom written ETL) would get a locked exception when trying to read the file while it is still being written.
Simply implemented a delay loop into our ETL. First time it sees the file during a processing period (18 hours NOT based on date) it sets a time flag. ETL will then ignore the file until the delay period has expired. As the delay is a setting we can vary it if there are still clashes, it is currently set on 120 seconds.
I think your issues is a management problem, are the next set of files (5) the same name as the first set (very nasty) or are there discreet sets of 5 files all the same name going into the different folders 9you only have to manage the file names and a count of folders processed per file name).
Create a table with filename and either a folder count or a time for each folder if more detail is required. Stick the filename in there the first time the file arrives with the folder details if required, keep going till filled (count = 5 or each folder col has a time) Write the file to a log. Flush the table every period with incomplete loads.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Could you try something like this:
Read each xml file one by one, and as each file is handled, write a "handled" file in the directory. Once ALL xml files are handled, rename the "handled" files to "finished" files.
Hope this helps.
Roy.
Roy.
|
|
|
|
|
OK, I cannot find any VB samples, (different issue if I was doing things in C#). Any way, I am using WebClient class and am successfully reading the XML file of business videos in my xaml.vb file asynchronously. But I am having a problem populating the datagrid properly:
<videos>
<profession name="lawyer">
<video id="1" title="Lawyer Title 1" />
<video id="2" title="Lawyer Title 2" />
</profession>
<profession name="doctor">
<video id="1" title="Doctor Title 1" />
<video id="2" title="Doctor Title 2" />
</profession>
</videos>
Here's my query
Dim BizVideos = _
From videos In xmlVideos.DescendantsAndSelf("profession") _
Where videos.Attribute("name") = "doctor" _
Select videos
dgridVideoList.ItemsSource = BizVideos
Here's the problem I am experiencing:
1. I am only getting one row in the datadrid with everything included in that one row, as opposed to what I want, i.e. one row for Video ID 1, and one for Video ID 2.
2. I am getting more fields in the datagrid than I want, i.e. "Has Elements", "Has Attributes", "Parent Node", etc.
Can anyone offer me (a.) the correct syntax for the query where I can break out the video child nodes under profession doctor and diplay them one video per row (b.) avoid showing superflulous fields like "Has Attributes", "Parent Node", etc., as well as (c.) what I am doing wrong in the binding of my datagrid?
Thank you all for your help.
|
|
|
|
|
I need to insert records from one MS Access database table to another MS Access database table.
i'm writing the code using vb.net 2003 windows application with MS Access 2003 database.Kindly give
me the steps to achieve this.and if possible sample code as i'm stuck somewhere in coding part.
thank you
regards
chandru
|
|
|
|
|
Let us see where you got Stuck, show us the code
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi Vuyiswa Maseko
I mean to say i can able to connect to single database using the connection string code.i'm able to do the actions like add, modify, delete, records in a single table or even i can do data manipulations b/w two tables of the same database mdb file.
But i said i don't know how to make a connection for two different database files(i mean 2 separate mdb files). i don't know how to add records from 1st mdb table to 2nd mdb table.there won't be any necessity for checking records duplication while inserting new records.kindly suggest me how to proceed and solve this.kindly give me the coding part if possible.
thank you
|
|
|
|
|
hi chandrubngit
If i understand you correctly you want to use two Tables from Different Databases. if So you can Declare two Connectionstring and Use one when needed see the Following Example
chandrubngit wrote:But i said i don't know how to make a connection for two different database files(i mean 2 separate mdb files).
class DAL
{
String constrCustomers = @"User ID = sa; Password=wow;Server=MYSERVER;Database=Customer";
String constrEmployees = @"User ID = sa; Password=wow;Server=MYSERVER;Database=Employer";
SqlConnection con;
SqlCommand cmdCustomer;
SqlCommand cmdEmployees;
SqlDataAdapter da;
public DataTable Get_Customers()
{
con = new SqlConnection(constrCustomers);
cmdCustomer = new SqlCommand();
cmdCustomer.CommandTimeout = 0;
cmdCustomer.CommandType = CommandType.Text;
cmdCustomer.Connection = con;
cmdCustomer.CommandText = "Select Top 1 * from Customer_Table";
da = new SqlDataAdapter();
da.SelectCommand = cmdCustomer;
DataTable dt = new DataTable();
try
{
con.open();
da.Fill(dt);
}
catch (SqlException)
{
throw;
}
finally
{
con.close();
}
return dt;
}
public DataTable Get_Employees()
{
con = new SqlConnection(constrEmployees);
cmdEmployees = new SqlCommand();
cmdEmployees.CommandTimeout = 0;
cmdEmployees.CommandType = CommandType.Text;
cmdEmployees.Connection = con;
cmdEmployees.CommandText = "Select Top 1 * from Employees";
da = new SqlDataAdapter();
da.SelectCommand = cmdEmployees;
DataTable dt = new DataTable();
try
{
con.Open();
da.Fill(dt);
}
catch (SqlException)
{
throw;
}
finally
{
con.close();
}
return dt;
}
chandrubngit wrote:i don't know how to add records from 1st mdb table to 2nd mdb table.
On my Opinion i think this part should be handled from the Database side not in the Data Layer.
Hope this Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
modified on Monday, January 5, 2009 6:13 AM
|
|
|
|
|
Hi developers!!!, I have a question in VB. (sorry, my english is bad)
how can VB intercept a file operation?
I've checked out the FileSystemWatcher sample from MSDN.
but i don't know how detect when a user try modify or delete or open a File.
For example y need intercept when the user or other program try modify or delete or open a file and after ALLOW or NO ALLOW these actios.
Thanks !!!
Orlando Herrera
Mexico
|
|
|
|
|
I don't think you can unless you control the file manage program. Write your own explorer and add in the management you need. Not sure if you can actually remove explorer from the windows OS mind you.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Explorer is just a pretty user interface onto the file system. It doesn't actually do much in terms of disk operations. That is all handed off to a lower level part of the operating system.
In order to get the level of interaction with the file system the OP wants then he is going to have to learn some C or C++. This is not something that can be achieved in VB.
|
|
|
|
|
You could store information about the files you want to protect (or even actual copies of the files). Then, when the FileSystemWatcher indicates a change has been made, you can determine whether that change was allowed. If it was, update your copy of the file with the new one. If not, then overwrite the changed file with your copy of that file.
|
|
|
|
|
And in the meantime in a multi-user / multi-threaded environment another process has picked up the file that was "protected" before your process can get in there and change it back.
|
|
|
|
|
There were no requirements given in the original post. Not all solutions apply in all situations. It's up to the poster to determine what is appropriate - not you.
|
|
|
|
|
The JZ wrote: There were no requirements given in the original post
Actually, there was. The OP wrote "For example y need intercept when the user or other program try modify or delete or open a file and after ALLOW or NO ALLOW these actios".
The OP clearly states the need to "intercept" and "allow" or "no[t] allow" the operations. Your solution did not do that. It did monitor the action and correct it after the fact. That is not the same as the OP was asking - He didn't want the action to happen in the first place.
|
|
|
|
|
There were no requirements pertaining to multi-users or multi-threading, as you posted. The question was to intercept file operations. There were no requirements as to how to that - user requirements, environment requirements, and so on. The only requirement that can be assumed is that VB must be used since this is a VB forum.
I felt I had an idea to share. If you did not like my idea, I do not care. But if I feel I can provide an idea, I will continue to do so.
|
|
|
|
|
The JZ wrote: There were no requirements pertaining to multi-users or multi-threading, as you posted.
Yes, there was. It is running on Windows therefore the requirement exists by default. Just by booting windows you have many processes and services starting up - each of these has at least one thread, and they all run in many user accounts. A user is not necessarily a physical person.
The JZ wrote: The question was to intercept file operations.
Yes, and that file operation would have to be made on some other thread somewhere otherwise what's to intecept. So that accounts for the multi-threaded part. And since threads can have different user security contexts that accounts for the multi-user part.
The JZ wrote: If you did not like my idea, I do not care
You are arguing - therefore you care.
|
|
|
|
|
SO.....in resume ?
can i do it with VB or not?
i think that people have diferents ideas, but is good all Replys.
i want only controll with my application:
for example:
when a program try open "c:example.txt", my application notify to me
"heeey program JON DOE(any example) want modify this FILE" and I clic
ACEPT or DENY.
LIKE Windows Vista is other good example. When you execute a program
Vista ask you..."really, you want execute this program?" and you clic ACEPT or CANCEL
|
|
|
|
|
|
This is not a right place to post what you just posted
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Where is the right place then?
Kevin
|
|
|
|