|
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
|
|
|
|
|
|
Well, as this is a VB forum I thought it would be more appropriate to mention it in a VB forum! It does say "Visual Basic / VB.NET discussions" after all.
Plus I thought that posting it here would avoid the usual hysterical anti-VB rants that you get elsewhere in Code Project.
Kevin
|
|
|
|
|
You are Right but in the VB Forum we expect only coding or Technical Questions and for more info about vb or any languages that you have to share,then General Discussions Forum will be appropriate for it. we do go to Discussions Forum and we will get the info there
Thanks
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,all
iam facing problem that how i assign value to columnspan property of tablecell.
i have two values start_cell_number and end_cell_number
for suppose cell number 4 to 8 i want merge these cells i mean it will be one cell
how i do that .
please give me hint or any suggestion.
any help or hint ?
Regards
Rameez
|
|
|
|
|
I'm trying to figure out what you are talking about until I realised you cross posted from the ASP forum. Where this belongs.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for your reply ,
its actually asp.net question sorry for posting here . iam using table server control for displaying data from database visullay
Again sorry for mistake .
Regards
Rameez
|
|
|
|
|
Hi
I am developing a software and i am using a exe in my programe. and i want to change the exe Icon using my software. how i do this.
Please suggest.
Thanx
~Khatri Mitesh
|
|
|
|
|
In the Project's properties.
|
|
|
|
|
I want to change the exe icon from other exe.
Thanx
~Khatri Mitesh
|
|
|
|
|
~Khatri Mitesh~ wrote: I want to change the exe icon from other exe
Can you really do this?
|
|
|
|
|
Just use another program to do it. I'm sure you can do it in code but I don't know how. A search[^] will help.
|
|
|
|