|
If you just want a general introduction into XML and it's related technologies check out W3Schools.com[^]
|
|
|
|
|
i use this code to store image in my database
*********************
Dim DR As DataRow
DR = Ds_products1.employees_dir_sp.NewRow
SqlInsertCommand1.Parameters("@emp_fname").Value = txtfname.Text
SqlInsertCommand1.Parameters("@emp_mname").Value = txtmname.Text
SqlInsertCommand1.Parameters("@emp_photo").Value = PictureBox1.Image
DR("emp_fname") = SqlInsertCommand1.Parameters("@emp_fname").Value
DR("emp_mname") = SqlInsertCommand1.Parameters("@emp_mname").Value
DR("emp_photo") = SqlInsertCommand1.Parameters("@emp_photo").Value
Ds_products1.employees_dir_sp.Rows.Add(DR)
da_empdir.Update(Ds_products1.employees_dir_sp)
************************************************
so when i click the save button that message apeear
"object must implement iconvertible"
ma_refay
|
|
|
|
|
|
Hi there,
Is it possible to get the last value updated in a table after an update operation has been conducted
Any help would be greatly appreciated
leo
Kathmandu, Nepal
|
|
|
|
|
Begin tran
update statement.....
.....
rollback tran
vivek
|
|
|
|
|
anj1983 wrote: Is it possible to get the last value updated in a table after an update operation has been conducted
A column of type TIMESTAMP can be used for it, because each time when a row is modified, the timestamp's value get chnged. Moreover it stores value in binary number. Alternately you can use a column of type DATETIME, and programmatically modifiy its value when updation takes place. Using this technique you trace recent update operation.
Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
I'm having a problem pulling data from sql 2005 on my local machine in an asp.net 2 project. I've set up sql with windows authentication, and i've tried adding logins with sql authorization and rights etc. but to no avail. The connection finds the server, db etc. but gives an security/auth error when executing the query. Do I have to reinstall sql or what???
Regards,
Tintin
|
|
|
|
|
Hi!
You have to set your SQL 2005 service to mixed mode authentication (do that in the property window of your server in management studio: Right-click your server in object explorer, Properties, Security, SQL Server and Windows Authentication mode).
If you do not change to mixed mode you cannot use sql authentication.
Regards,
Rainer.
Rainer Stropek
Visit my blog at http://www.cubido.at/rainers
|
|
|
|
|
Hi ,
pls help me out with this code
insert into chk values('notwking',convert(datetime,getdate(),101))
the row gets inserted into the table(type varchar, type datetime).
but if i try to retrive that record by this query
select * from chk where dt between getdate() and getdate()+20
i dont get that tuple
but i get the same with this query
select * from chk where dt between getdate()-1 and getdate()+20
i thnk the problem is with the time part which is inserted during insertion.
is there any solution.Pls help me out
Thnks in advance
|
|
|
|
|
Always use DateDiff when working with date.
Syntax: DATEDIFF([datepart], [firstdate], [seconddate])
where datepart can be day, month, year, etc.
Example:
WHERE DATEDIFF( dd, GETDATE(), @myDate )
BETWEEN DATEDIFF( dd, GETDATE(), @dateFrom )
AND DATEDIFF( dd, GETDATE(), @dateTo )
Does that help?
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
try this out ...
i.e. insert into chk values('notwking',convert(char,getdate(),105)
the time part will be removed.
vivek
|
|
|
|
|
Hi,
thks fr the advice but insert into chk values('notwking',convert(char,getdate(),105) is actually trying to insert char datatype into datetime field right.
regards
-- modified at 5:25 Wednesday 21st June, 2006
|
|
|
|
|
hi,
obviously yessssss..............
vivek
9868079257
delhi
vivek
|
|
|
|
|
I am about to start working on a little web application that will run with an Oracle database as the backend. Since I won't have control of the database, I was thinking of embedding PL/SQL queries inside my data layer, so that I will only have to ask for the DBA to create 4 or 5 tables (yeah, that small!).
Knowing that Oracle doesn't support identity columns, and that you must use sequences (which as far as I know require me to write stored procedures), I thought about GUIDs as primary keys for my tables (specially since I can use them just like int s in C#).
But a quick search on the web didn't reveal any information on Oracle 10g having a built-in GUID datatype. If it isn't so, then I am worried that a few joins on an array of bytes will be very slow.
What do you all think?
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
Hi,
I am Vijay I want to know How to Read Data From Password Protected Acces Database Using VB Program.If Any One has Solution fort this Problem...Please send Reply in the Following Mail; Address.
Vijaykrishnanv@rediffmail.com or viju.nvidia@gmail.com
|
|
|
|
|
You just need to pass the password into your connection string.
See this link[^].
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
* i have a column that store simages in my database
i make the image column type is (image)
so when i try to insert image into my data base message appear " u must use iconvertible"
what is that "iconvertible" and how to use it?!!!!!!!
* i make image column allow null so if i try to insert row without image message apear meaning i can't use null i must use dbnull.
what is the dbnull and how allow image column to be allow null with errors?!!
ma_refay
|
|
|
|
|
ma_refay wrote: * i have a column that store simages in my database
i make the image column type is (image)
so when i try to insert image into my data base message appear " u must use iconvertible"
what is that "iconvertible" and how to use it?!!!!!!!
I've never seen that error message - Are you passing the data as a byte array: byte[]
ma_refay wrote: * i make image column allow null so if i try to insert row without image message apear meaning i can't use null i must use dbnull.
what is the dbnull and how allow image column to be allow null with errors?!!
DBNull is used to signify a null in the database. In certain situations a null can be ambiguous. For example: I use ExecuteScalar and the result is null . Is it null because there is no data being returned, or is it null because the data I requested is a null value in the database? To disambiguate, all null s from the database are DBNull.Value
Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?
My: Website | Blog
|
|
|
|
|
i use this code to store image in my database
*********************
Dim DR As DataRow
DR = Ds_products1.employees_dir_sp.NewRow
SqlInsertCommand1.Parameters("@emp_fname").Value = txtfname.Text
SqlInsertCommand1.Parameters("@emp_mname").Value = txtmname.Text
SqlInsertCommand1.Parameters("@emp_photo").Value = PictureBox1.Image
DR("emp_fname") = SqlInsertCommand1.Parameters("@emp_fname").Value
DR("emp_mname") = SqlInsertCommand1.Parameters("@emp_mname").Value
DR("emp_photo") = SqlInsertCommand1.Parameters("@emp_photo").Value
Ds_products1.employees_dir_sp.Rows.Add(DR)
da_empdir.Update(Ds_products1.employees_dir_sp)
************************************************
so when i click the save button that message apeear
"object must implement iconvertible"
ma_refay
|
|
|
|
|
|
|
I created a windows form in VS2005 that uses Enterprise Library - DAAB - version Jan 2006 to access the DB in its constructor. Everything works fine; however, when I created a UserControl that attempts to store that form as a variable, the VS 2005 designer will not let me drag that UserControl onto a new form. It gives me the following error:
“Failed to create component ‘UserControl’. The error message follows: ‘System.NullReferenceException: Object reference not set to an instance of object. At Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.get_DefaultName(), at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseMapper.MapName(String name, IConfigurationSource configSource)…….”
Everything compiles successfully without errors; however, I am unable to use the UserControl on any forms. After debugging, I found that the error is caused by the line “Database db = DatabaseFactory.CreateDatabase();” This line is standard DAAB code and is supposed to work and it does works in all cases I’ve run across EXCEPT this.
Is this a bug in the DAAB, or VS Designer, or am I missing something? Any help will be appreciated! Thanks in advance!
Below is the relevant code:
public partial class SampleControl : UserControl
{
private ProductForm subForm = new ProductForm();
public SampleControl ()
{
InitializeComponent();
}
}
public partial class ProductForm : Form
{
public ProductForm()
{
InitializeComponent();
AccessDB();
}
private void AccessDB()
{
//THIS LINE CAUSES THE DESIGNER ERROR
Database db = DatabaseFactory.CreateDatabase();
}
}
Thanks
|
|
|
|
|
I don't know how this relates to your problem - perhaps the full stack trace would be more helpful - but there are a number of things that stand out as being, at best, a little odd.
You are instatiating a form during the construction phase of your user control - Why do you need this form? Why not construct it just as you are about to use it? That would seem to be a better design.
Although you receive some kudos for using the Enterprise Library, you are not using it in a Dal - you're just dumping the data access in the form like the designer would - This is great for a simple throw away app you are only going to use one, but for an enterprise application data access should be tucked away in a DAL (Data Access Layer). The Enterprise Library DAAB on its own is not a DAL, it just makes the creation of a DAL much easier.
Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?
My: Website | Blog
|
|
|
|
|
The problem is not with either the DAAB or the Visual Designer. They are functioning as intended and doing just what you are asking them to do.
The problem as Colin points out is with your design. When your control is being rendered in the designer it is trying to instantiate the form. Again, as Colin suggests, a better approach may be to remove the form from the creation process and move the DAAB to a DAL.
|
|
|
|
|
Folks,
We had a server crash, but were able to restore our database files from the disk. Having rebuilt our server, we would now like to restore the database, but we're unable to figure out to re-attach the .MDB file, as it was not detached prior to the crash.
We're using SQL v7.0.
Any help would be greatly appreciated.
TIA!
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|