|
i've created a new database with 2 table in microsoft access 2003 (.mdb)
I've created a query too, embedded in the .mdb file.
Can i use directly this query in ADO.NET avoiding to write SQL comand in c# code?
|
|
|
|
|
Yes u can. You can refer to this query as the store procedure in C# and call at as you are calling a store procedure.
Akif
|
|
|
|
|
Does anyone know how to use just the time portion of a DateTime object when calling an SQL Query (using SQL Server). I have a field in the database that stores only the Time, and want to do a select based on this field, but it forces me to match the Date portion of the field or it will not work. So, as simple example, if wanted to get all records with time of 9:30am, would use a Command something like:
<br />
DateTime timeToGet = new DateTime(1900,1,1,9,30,0);<br />
SqlCommand command = new SqlCommand();<br />
command.CommandText = "Select * from MyTable where MyTime = @TimeParam";<br />
SqlParameter parameter = new SqlParameter();<br />
parameter.ParameterName = "TimeParam";<br />
parameter.SqlDbType = SqlDbType.DateTime;<br />
parameter.Value = timeToGet;<br />
command.Parameters.Add(parameter);<br />
This will work fine as long as Date portion of field in database = 1/1/1900. But, if date portion is something else then will not find record.
Maybe it would work if could pass it a Time-Only object (instead of DateTime object) but not sure if object like that exists, and if did, not sure parameter object could handle it.
If anyone has any ideas, please let me know.
Thanks,
BK
|
|
|
|
|
SELECT * FROM mytable WHERE CONVERT(CHAR(8), mytime, 8) = CONVERT(CHAR(8), @TimeParam, 8)
|
|
|
|
|
Hi..
I want to put a page in asp ( or if not possible I could also use dot.net) to my server that will report about instant number of
> open database connection object number
> open recordset object number
> connected user number (not by counting from global.asa)
> ram and cpu used by iis...
and any usefull data like above..
where to start
karanba
|
|
|
|
|
can i use truted connection with microsoft access database?
that is avoid to specified password and id value in the connection string?
can i use directive with .mdb?
i use c# language and ado.net
|
|
|
|
|
Ofcourse you can use that !
R A M
|
|
|
|
|
string strConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyNothing.MDB;Jet OLEDB:Database Password =MyNothing;"
|
|
|
|
|
sorry i mean connect to a password protected .mdb, but avoid to specified in the connection string the password used.
In SQL server i can do it but in .mdb access?
|
|
|
|
|
Sasuki,
Infact you have to populate the Password screen yourself in Access you can use this
string strConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyNothing.MDB;Jet OLEDB:Database Password =" & Text1.Text & ";"
OR
string strConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyNothing.MDB;Jet OLEDB:Database Password =" & InputBox$("Enter password") & ";"
R A M
|
|
|
|
|
I've recently completed a Pocket PC application in VB.NET that works with connections to a local SQL Server 2000 CE DB and a SQL Server 2000.
I'd like to look at doing the same thing using eMbedded Visual C++ 4.0 and OLE DB for a CE.NET device. While there are plenty of resources for SQL CE I can't find any for SQL Server 2000.
Does anyone know of a good sample for eVC++ that hits both SQL CE and SQL Server? No ActiveSync and no IIS for this solution thus RDA and Merge Repl are of no value.
Any input is much appreciated!
|
|
|
|
|
Can SQL Server views be constructed to take parameters?
Some assembly required.
Code-frog System Architects, Inc.
|
|
|
|
|
The short answer is no. But this link[^] says it much better.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
As far as I know you cant pass parameters to a view. As an alternative what you can do is create a user defined function in sql server (2000 and later) where you can pass parameters to the function,do what ever the process or selections you want and then return a table from the function.
Rohitha M.Hewa
Senior IT Executive
Naturub Group of Companies - Sri Lanka
|
|
|
|
|
I am using .NET C# to program a database program. I am modifying a program that already exists, and it creates an "SDF" file on my Pocket PC. Be warned, I am a very big newbie, and I've been trying to read up on this question, but it seems the more I read, the less I am understanding it all.
I have tried to install and use Microsoft Server 2000 (with Server CE), but I keep getting error messages 1069 and no matter waht I do, it doesn't seem to help.
So I was wondering if I could use a MySQL database for this program?
Furthermore, I have the database (with images/blobs) currently in MS-Access format, which was made on my PC. This is the database I would like to have on my PocketPC (I don't want to be able to edit it or anything. Just show it, with the pictures that go with the ID #.)
Thanks so much everyone. I'm really getting confused about this all.
|
|
|
|
|
Hi,
I want to create dynamic Microsoft Access Jet 4.0 database ( *.mdb) files and database schema ( tables (Data Definition Language ) ) using ADO connectivity.
For that I have come up with the solution to use ADOX technology which provides database and schema creation facility, for Microsoft Access Database.
So I want to know the latest version msadox.dll file thru which ADOX can be used to access database.
And also write feasibility of using ADOX technology instead of ADO technology.
Please be hurry...........
Its urgent....
Thanks and Regards,
Karnav
Thanks and Regards
Karnav Zaveri,
Prodcut Development Engineer,
Amtel Security Systems.
|
|
|
|
|
Hi I am developing and web app for my final year in college but I am having problems trying to keep my 2 databases up-to-date (one in college and the other at home) I’m just wondering if there is anyway to copy a single table from the college db to the home including the table design and data etc. So I’m just wondering if anyone has any ideas of how I would go about doing this
Thanks in advance
Tim
|
|
|
|
|
try to BackUp DataBase then in ur PC call it by Restore
hope helps???
|
|
|
|
|
no i need to copy one tables data from one database to another not the whole database
|
|
|
|
|
If it is just data, then you should be able to use some kind of Unload/Load utility for your database to do this. Additionally most databases also have some kind of Export/Import utility that will also include the the table design info that you are after.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Hey folks,
i've run into a sort of brick wall this weekend, and can't find much that will work....here's the issue.
i need to do an insert into 2 tables, for an invetory control app,
I know this query is wrong, its just a description of what i want to do...
Insert into PC (PC_Service, PC_Serial, mon.mon_name, PC_Model, PC_Name, PC_Loc, PC_IP) <br />
values(1, 'SerialNujmber','SerialNujmber', 'Model1', 'deviceName', 1, '192.168.0.1') <br />
select *<br />
from mon inner join pc<br />
on pc.pc_id = mon.mon_to_pc <br />
where <br />
pc.pc_serial = '123456789'
or
"Insert into Mon ( Mon_loc, Mon_Serial, Mon_serial2, mon_service, mon_to_pc) <br />
values ('1', 'KR-032DVX-47602-19Q-ABKQ', 'kermit the frog', '1', (select PC_ID from PC where pc_serial = 'fasdf'))"
the first is the overall desire...the second is my last resort..
Any ideas will be helpful
thank!!!
string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";
Why is common sense such an un-common comodity?
|
|
|
|
|
You could do something like this:
INSERT INTO Mon (Mon_loc, Mon_Serial, Mon_serial2, mon_service, mon_to_pc)
(SELECT '1', 'KR-032DVX-47602-19Q-ABKQ', 'kermit the frog', '1', PC_ID
FROM PC where pc_serial = 'fasdf') Or if you are using a stored procedure, get the PC_ID into a variable, and use it in the INSERT . The above query will insert multiple records if the SELECT PC_ID FROM PC happens to return multiple records, although by looking at the name of the fields, I wouldn't think so for this particular case.
I hope this helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
That Worked!!!!
THANKS
string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";
Why is common sense such an un-common comodity?
|
|
|
|
|
You're welcome! I'm glad I could help!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
I am not that good in asp.net and sql.
I need a simple piece of code to see if a value is in a datatable.
Allready have this but how to proceed:
Dim LUConn As SqlConnection = New SqlConnection("server=localhost;uid=sa;pwd=;database=EventMngt")
Dim LUString As String = "SELECT * FROM C_Registered_horses WHERE Horse_Name = " & Horse_Name.Text
Dim objLUConnCommand As New SqlCommand(LUString, LUConn)
Dim objConnReader As SqlDataReader
Try
LUConn.Open()
objConnReader = objLUConnCommand.ExecuteReader()
Catch Err As Exception
MessageLabel.Text = "Horsename not found. Try again or use Passport number." & Err.Message
Horse_Name.BackColor = System.Drawing.Color.LightGoldenrodYellow
btnSubmitNext1.Visible = "false"
Finally
LUConn.Close()
MessageLabel.Text = LUString
Horse_Name.BackColor = System.Drawing.Color.LightGreen
btnSubmitNext1.Visible = "true"
End Try
Any help is welkom.
|
|
|
|