|
The SqlConnection[^]class is your starting point, you should find all the example code you need for the database connection stuff from that link.
Here[^] is a quick link to how to read text files in C#.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
help me...
I have some troubles with M.Access. I want to create the calendar control on a form of my Access database like the calendar control of vb.net or C#. However, I can't find the way to do that .Thus, I'm very happy if you help me...
|
|
|
|
|
You have insert the "Microsoft Date And Time Picker Control". Usuary it's at the tools floating window, if it isn't, you'll have to search for it in "ActiveX Controls" in the Tools menu. Usually, it's available, but it depends on your Access installation.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Do someone know how to run a DTS package from stored procedure..
I need code syntax or example.
Thanx in advance..
--junior coder--
|
|
|
|
|
|
thanx for help
--junior coder--
|
|
|
|
|
is there a way to join two tables from two diffrent odbc data sources (or joining to dataset tables) ..any ideas?
|
|
|
|
|
Yeah it's easy
To create a relationship between 2 datasets create a datarelation. Look in the Visual Studios help index for datasets, relationships
Thier example is as follows.
Dim CustomersOrders As New DataRelation("CustomersOrders", _
DsNorthwind1.Customers.Columns("CustomerID"), _
DsNorthwind1.Orders.Columns("CustomerID"))
DsNorthwind1.Relations.Add(CustomersOrders)
"People who never make mistakes, never do anything."
My blog
http://toddsnotsoamazinglife.blogspot.com/
|
|
|
|
|
I am using VC++ dot NET, and am trying to use GetRows to populate an array with the rows from one of the columns in a table. My adodb recordset contains the data. I know the recordset has
200 rows in one column, so I have:
float data[200]; <br />
data = p_myRecSetPtr->GetRows(-1);
and I get the error: "error C2440: '=' : cannot convert from '_variant_t' to 'float []'"
I tried casting the result but couldn't get it to work right.
Does anyone know how to solve this problem? or possibly what cast I need to use?
|
|
|
|
|
Yes, you need to do this:
_variant_t vt = p_myRecSetPtr->GetRows(-1);
You can't magically change what the function returns. It's probably a SAFEARRAY, which has a nice wrapper class, called CComSafeArray from memory.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi
I have to create an MDB file and then create a table in it.
I have successfully been able to do this task in a simple web-application.
But when I do the same thing in a webservice it creates the MDB file but gives me an error while opening the connection to this file with no details just saying "Unspecified error".
I have checked for the ASP.NET permissions.
string connection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= ";
connection += "C:\\Projects\\Data\\Data.mdb";
string error = "";
OleDbConnection conn = new OleDbConnection();
try
{
conn.ConnectionString =connection;
conn.Open();
}
catch(Exception Ex)
{
error = Ex.Message;
}
|
|
|
|
|
Hi,
If you want to access an Access database from an ASPX page, you must add to your connection string "User Id=admin;Password=;" for a standard security access.
Of course, the ASP.NET user (under winxp) must have enough rigths on the .mdb file.
I hope this will help you,
Regards.
PS: for more details on connection strings, check http://www.connectionstrings.com/[^]
jmarzou
|
|
|
|
|
I want to update a table in database.
The datasource is a xml file , which read by dataset.
How to update the table ?
I use these code,
Dim cmd As New OleDbCommand
cmd.Connection = cn
cmd.CommandText = "select * from " + m_tablename
Dim da As New OleDbDataAdapter
da.SelectCommand = cmd
Dim ds As New DataSet
da.Fill(ds)
ds.Clear()
ds.ReadXml(m_xmlname)
da.Update(ds, m_tablename)
However, the database do not be updated.
Please help me.
Thanks!
|
|
|
|
|
Hi,
I am trying to create a job ,use Activex Script (VBScript) as language at first step of my job. But i can not make it work.If i write:
'--------
Dim value1
value1="something else"
'----------
it works but, if i write something complex it fails:
'-----------
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("c:\\test.txt",1)
f.ReadAll
f.Close
Set f=Nothing
Set fs=Nothing
'-----------
Would someone give me some working code or tell me the probable mistake that i make?
Thanx in advance..
--junior coder--
|
|
|
|
|
Hi all thanks for reading. I am kinda new to stored procedures and need a bit of help. I am calling a stored procedure which I send 2 parameters, lets say @first_name and @column_name.
I am using a
SELECT * FROM members WHERE @column_name = @first_name
but when I run the procedure I get no results.
Is this valid? MS VS.net allows it and runs the procedure but I get no return?
if I alter the procedure to say
SELECT * FROM members WHERE first_name = @first_name
I get the desired results
Here is my stored preocedure
ALTER Procedure DBSearch (@first_name varchar(40), @column_name varchar(40))
as
select * from members where @column_name = @first_name;
RETURN
Thanks in advance for any help
BigJRags
|
|
|
|
|
Try this:
declare @sql varchar(500)
set @sql='SELECT * from members WHERE ' + @column_name + ' = ' + @first_name
exec(@sql)
<italic>Work hard, Work effectively.
|
|
|
|
|
That looks good to me but it's not working???
|
|
|
|
|
Why is it not working? Try
select @sql
and run the query manually.
<italic>Work hard, Work effectively.
|
|
|
|
|
I wish I knew, here is the Procedure and the Output, when I right click and select Run Stored Procedure, I use Jeremy as @param1 and first_name as @param2
I am stumped...Any clues?????????????????/
ALTER Procedure DBSearch (@param1 varchar(40), @param2 varchar(40))
as
declare @sql varchar(500)
set @sql='SELECT * from members WHERE ' + @param2 + ' = ' + @param1
exec (@sql)
RETURN
Running dbo."DBSearch" ( @param1 = Jeremy, @param2 = first_name ).
Invalid column name 'Jeremy'.
No rows affected.
(0 row(s) returned)
@RETURN_VALUE = 0
Finished running dbo."DBSearch".
|
|
|
|
|
Edberg was right, see below.
<italic>Work hard, Work effectively.
|
|
|
|
|
I think with that one you need to add apostrophe (') as the column expects character value.
Try replacing the set @sql with this:
set @sql='SELECT * from members WHERE ' + @column_name + ' = ''' + @first_name + ''''
|
|
|
|
|
That did the trick, thanks a million
|
|
|
|
|
You can't use a parameter for a field name...
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Hello all,
I am enhancing a DTS package developed by someone else. Main purpose of the DTS package is to import the data from the input excel sheets received from multiple customers.There are 7 data pump tasks to import from 7 customers' excel sheets. Each pump task is called in a loop in an ActiveX Script to be executed.
In ActiveX Script following logic is used to execute the pump task:
set stpraj = pkg.Steps("DTSStep_DTSDataPumpTask_2")
stpraj.ExecutionStatus = DTSStepExecStat_Waiting
I added a new data pump task to import the data from a new customer and I used the same logic as above:
set stpram = pkg.Steps("DTSStep_DTSDataPumpTask_8")
stpram.ExecutionStatus = DTSStepExecStat_Waiting
when I executed the package it gave execution errors. I replaced the code stpram.ExecutionStatus = DTSStepExecStat_Waiting
with
stpram.execute.
Now the package is executing properly and populating the data, but some of the things I did not understand are:
1. Why the package gave execution erroers when I used "stpram.ExecutionStatus = DTSStepExecStat_Waiting" ?
2. In the results after the execution of the package it showed the status for
"stpraj.ExecutionStatus = DTSStepExecStat_Waiting" as "COmplete" and for "stpram.execute" it showed "Running".
What is the difference between "stpraj.ExecutionStatus = DTSStepExecStat_Waiting" and "stpram.execute"? which one is preferable?.
Any information and suggestions on above doubts please!
Thanks in advance.
|
|
|
|
|
How do I bring up the ODBC Configuration dialog box and retrieve the paramters from VB . Net?
JRM
|
|
|
|