|
Colin's answer was more or less correct. Since you are using Access, you need to use the OleDb * classes.
using(OleDbConnection conn = new OleDbConnection(connString))
{
OleDbCommand cmd = new OleDbCommand("SELECT sm_referencetext0 FROM calpackage WHERE sm_trakingno = ?", conn);
cmd.Parameters.Add("param1", txttrack.Text);
label.Text = (string) cmd.ExecuteScalar();
} For the connection string for your database, check http://www.connectionstrings.com[^], but it should look something like this:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User Id=admin; Password=;"
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hello friends!!!!!!!!!!!!!
I expand "Management"
then I expand "Current Activity"
then I expand "Locks / Object"
in the tree on the left side (not the opened window) I see a list of
databases and the objects in each database currently with a lock placed on it.
Most of the listings in this tree are something like:
Northwind.dbo.Categories
but what I'm seeing for one particular database is something like this:
Northwind.jdoe.Categories
Normally I make all objects owned by dbo, however I have some systems that
require another user to be the object owner. such example. However the owner of all the objects is not this "jdoe", but
let's say "jsmith". In which case I would expect the tree listing the
objects being locked to look like this:
Northwind.jsmith.Categories
NOT
Northwind.jdoe.Categories
especially, as I stated previously, since jdoe is just a valid user in
the db.
So, I'm still confused..
How could I remove this jdeo????????????????????
I will remove him by sp_changedbowner.
but why and how that 'jdoe' comes in picture!!!!!!!!!!
Is there any perticular command or login type work because of
that 'jdoe's' name came into picture?????????????????
Help Me Out!!!!!!!!!!!!!!!!
Regards
shashank
|
|
|
|
|
Hi,
I'm a newbie in this but I what to make a VB.NET application that adds a jpg picture to row in a SQL Server 2000 database.
Thanks in advance.
Dino Sousa
|
|
|
|
|
1 you can create a proc first like:
create proc p_pic_i
@filename nvarchar(100),
@filesize int,
@jpgdate image
as
insert into pic (
filename,
filesize,
filedata)
values (
@filename,
@filesize,
@filedata)
if @@rowcount = 1 and @@error = 0
return @@identity
else
return -1
go
2 then write a function to call this proc, sorry this is c# not vb.net
public int csf_p_News_ext_i(
string filename,
int filesize,
byte[] filedata,
SqlConnection conn)
{
SqlCommand cmd = new SqlCommand("p_News_ext_i",conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@RETURN_VALUE",SqlDbType.Int,4);
cmd.Parameters["@RETURN_VALUE"].Direction =
ParameterDirection.ReturnValue;
cmd.Parameters.Add("@filename",SqlDbType.NVarChar,200);
cmd.Parameters["@filename"].Value = filename;
cmd.Parameters.Add("@filesize",SqlDbType.Int,4);
cmd.Parameters["@filesize"].Value = filesize;
cmd.Parameters.Add("@filedata",SqlDbType.Image);
cmd.Parameters["@filedata"].Value = filedata;
int retvar = -1;
try
{
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
retvar = (int)cmd.Parameters["@RETURN_VALUE"].Value;
}
catch
{
retvar = -1;
}
return retvar;
}
3 read stream(asp.net)
Byte[] FileByteArray = new Byte[filelength];
Stream StreamObject = UpFile.InputStream;
StreamObject.Read(FileByteArray,0,filelength);
|
|
|
|
|
Hi,
It looks like a great solution especially since I want to start to use store procedures. But it covers the upload do the database part... Can you help me with the download from database part too?
Thanks in advance,
Dino Sousa
|
|
|
|
|
asp.net,
try
{
SqlDataReader reader = this.oCon.GetReader(
@"select filesize,contenttype,filedata from file_personal
(index=pk_file_personal nolock) where fileid = " + e.Item.Cells[5].Text);
this.Page.Response.ContentType = (string)reader["contenttype"];
this.Page.Response.AppendHeader("Content-Disposition:",
"attachment; filename=" +
HttpUtility.UrlEncode(e.Item.Cells[7].Text));
this.Page.Response.OutputStream.Write((byte[])reader["filedata"],
0, (int)reader["filesize"]);
this.Page.Response.End();
}
catch
{
this.Page.RegisterStartupScript("",
"alert('error!');");
return;
}
ASP.NET Windows APP Mobile App
http://www.eReach.cn
|
|
|
|
|
Hi
Im trying to create an Microsoft Access Database using the SQL "CREATE DATABASE" command, but very attempt I have used has lead to an exception, so if anyone out there has an answer to my problem I would REALLY appriciate it
Wilye
|
|
|
|
|
can any one suggest how to perform
Tranfering of files and folders from one server to another server using asp.net
|
|
|
|
|
|
Hi there!
I have a activex dll written in vc++ 6.0
There is one function that needs to receive a Ado Recordset from a VBasic application. It seems that after the VB does the call to the function, the ADORecordset loses at least one property: Sort.
The function is receiving the ADORecordset as an IDispatch.
Any ideia is a good idea to this problem...
Thanks in advance.
António Carvalho
|
|
|
|
|
Hey guys, how do I:
SELECT AVG(SomeDateTimeColumn) FROM TimeLog WHERE EMPID=12345
Any useful script for lazy me? Thanks in advance.
Norman Fung
|
|
|
|
|
i don't understand neither your question nor your explaining sql query...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You can't AVG a datetime. I am not sure what you are getting at.
|
|
|
|
|
hi
i need code 4 currency convertor
automatic convert the currency
4 payment in online hotel reservation
thanx
viren
|
|
|
|
|
virendra kumar wrote:
i need code 4 currency convertor
It is a simple multiplication or division. Also, this question does not seem to have anything to do with databases.
Source currency * or / exchange rate = destination currency.
e.g. Pounds Sterling to US Dollars. Exchange rate: £1 == $1.87
£5 * 1.87 = $9.35
or US Dollars to Pounds Sterling
$10 / 1.87 = £5.34
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
virendra kumar wrote:
online hotel reservation
Maybe you need this.[^]
<italic>Work hard, Work effectively.
|
|
|
|
|
|
In my database i got:
ID, Name, Type, Comment
But when i fill to grid. my Columns reorder:
Comment, ID, Name, Type
But i want to have an ordier like in database. How can be done.
I used the tutorial on web:
http://www.c-sharpcorner.com/Tutorials/OleDbDataAdapterDesign.asp
I am using Jet 4.0 as connection
I have noticed if i change select statment, but there isn't any effect.
I hope i dit posted this on correct forum.
Can anybody help me. Thanks in advance.
|
|
|
|
|
I think the problem is in your grid. How do you fill the grid?
<italic>Work hard, Work effectively.
|
|
|
|
|
dgCDList->DataSource = core->databaseDataSet->CD;
core->oleDbCDData->Fill(core->databaseDataSet);
|
|
|
|
|
I need to set up a mail account for reporting services in SQL 2k
can anyone point me to some information
Thanks Paul
|
|
|
|
|
Hi all,
I would be most grateful of some help !!!!
I have a number of Text boxes (including a rich text box) and I simply want to insert the data into an access DB.
I have made a ADO.net connection, adapter and then it has generated a dataset (using GUI not code). I can display the data but just can’t find a good explanation of the statement needed to insert into DB
Any Help would be fantastic !!!!
Thanks
Martin
|
|
|
|
|
|
Hi,
Sorry to bother you but i am unfamiliar with C# and am still having big difficulty.
I need a very basic step by step help.
Would be most grateful
Thanks
Martin
|
|
|
|
|
C# uses the .NET framework, as does VB.NET. The API calls will be the same. Perhaps if you could break down exactly what you're finding hard - do you know anything about SQL to start with ? Do you know anything about how ADO.NET works ? Did you know how to bind a data source to a data grid, or did you copy the code from somewhere ?
If I have an idea of your skill level, and what bits you're struggling with, perhaps I can be more specific.
Christian Graus - Microsoft MVP - C++
|
|
|
|