|
Hello
I am writing an application that should export some data from an SQL server 2005 server to an SQL Mobile (sdf file) on an remote PC.
What is the best way of doing this?
I want the user to be abel to choose witch data that should be exportet. So it is not allways the complete database that will be exportet
The user will then modify the data on the remote PC, and the idee is that he/she then could "import" the data, with some merge (conflict solving) solution. Any idees on how to solve this is appreciated.
Cheers
Spaz
|
|
|
|
|
Hi everyone.
pls help,I am busy with the security access system which monitores arrival ,lunch and depature time,so I need to calculate the time length
eg my table looks like this:
Date Name TimeIN TimeOUT Length
12/2/2007 Myself 7:45 12:00 4:55
so how do I calculate that 4:55 which is the difference of TImeIN and TimeOUT,I need a sql statement or any calculation methods to do that.
Thanks in advance.
|
|
|
|
|
Hope this helps
DECLARE @dd AS datetime<br />
SET @dd =(SELECT convert(datetime,TimeOUT) - convert(datetime,TimeIN))<br />
<br />
SELECT convert(varchar,@dd,108) AS minutes
|
|
|
|
|
thanks,but is still not working because the datatype of TimeIN and TimeOUT is Nvarchar not datetime,I did that because I wanted to insert them as DateTime.Now.ToShortDateString();so how will I manage to get the difference of nvarchar datype fields.
help....
|
|
|
|
|
try converting fields TimeOUT and TimeIN in varchar datatype.
DECLARE @dd AS datetime<br />
SET @dd =(SELECT convert(datetime,cast(TimeOUT as varchar)) - convert(datetime,cast(TimeIN as varchar)))<br />
<br />
SELECT convert(varchar,@dd,108) AS minutes
|
|
|
|
|
you can use the datediff function to dothis!
first, get the differnce in hrs and then find the difference in minutes....
Gautham
|
|
|
|
|
Hi every body.
i want to have a query in sql server 2000 which loads the sets of number less than 100. what should i do?
SELECT ? [WHERE]?
Thanks
Rastgar
|
|
|
|
|
m.rastgar wrote: i want to have a query in sql server 2000 which loads the sets of number less than 100. what should i do?
SELECT ? [WHERE]?
If you are storing numbers in a column called "MyNumbers" in a table called
"MyTable" , then to get all numbers less than 100 you can do:
SELECT MyNumbers FROM MyTable WHERE MyNumbers <100
Here is a good place to start leaning SQL[^]
|
|
|
|
|
Hi ..
I'm using Vb.net 2000 and Sql Server 2000 .. and I'm using the next code to connect with database ..
Public SqlCon As SqlConnection = New SqlConnection("workstation id=DESKTOP;Password=123; packet size=4096;user id=sa;integrated security=SSPI;data source=ComputerName;persist security info=False;initial catalog=Data")
I prepare a server and the network is allready work , and the dotnet framework 2 is installed on all pc on ... and every thing is good , when I run the program on anohter pc on the net work the next message error is appearing...
Could not load file or Assembly ( ADODB, Version=7.0.3300.0, Culture=neutral , Publickey token = bo3f5711d5.a3a) or one of its dependencies . The system can nptfind the file specified
can any one help me
jooooo
-- modified at 3:26 Monday 12th February, 2007
|
|
|
|
|
Can any one help me >>
jooooo
|
|
|
|
|
Have you got the correct version of the framework installed? My understanding is that dotnet framework 2 would be for Vb.Net 2005.
|
|
|
|
|
andyharman wrote: My understanding is that dotnet framework 2 would be for Vb.Net 2005.
yes it's it ...
when I make the database local on any pc , it's work as good
but when I make centeralize db on the server .. the program doesn't work
jooooo
|
|
|
|
|
I want to write an Microsoft Access VBA sql query that allows me to trim text against a table field called template.
For each record the field will contain a string such as:
C:\ProgramFiles\Company\Templates\templatename.xml.
The bit I want is the template name.xml. However because the template name may be diffent for each field and because the directory path could be different for each field I need to use the last '\' as my marker to determine what to extract.
If anyone knows how to do this, any help would be appreciated.
Al
|
|
|
|
|
Mid([FilePath],InStrRev([FilePath],'\')+1)
|
|
|
|
|
Say I want to put in order details current price of product, but once it's assigned it stay as is (so if it's null copy from product table if not leave as is...).
How to do this?
|
|
|
|
|
IF EXISTS(SELECT PRICE FROM ORDER WHERE PRICE IS NULL AND PRODUCT=@YOUR_PRODUCT_ID)
BEGIN
--DO YOUR UPDATE HERE
END
ELSE
BEGIN
--PRICE ALREADY ASSIGNED
END
|
|
|
|
|
can you please help me out with the login/username and password for the sql query analyzer
jaffar
|
|
|
|
|
you can login with an user of your sql server (e.g. username 'sa' and the password that you set in the setup of sql server)
|
|
|
|
|
query analyzer itself does not have a username/password. What it's asking for is the username/password to the SQL Server database you want to log on to. The database may not be set up for SQL authentication (in which case the username/password are not relevant). Try selecting integrated security instead.
|
|
|
|
|
Hi,
I need a little help. I have created an untyped dataset on my form called dataSet1 and am trying to create a parent/child relationship with a datagrid displaying the data. But I am getting a weird exception on the code:
da.Fill(dataSet1);
The exception says: "Incorrect syntax near '*'"
I don't understand this exception atall.
Please help me,
Any reply is appreciated.
P.S. here is the full code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace NorthwindTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
string strConnect = @"server = (local)\SQLEXPRESS; integrated security = sspi; database = C:\SQL\NORTHWND.MDF";
string strQuery1 = @"SELECT * FROM employees";
string strQuery2 = @"SELECT * FROM orders";
string strQuery = strQuery1 + strQuery2;
SqlConnection conn = new SqlConnection(strConnect);
SqlDataAdapter da = new SqlDataAdapter(strQuery, conn);
da.TableMappings.Add("Table", "employees");
da.TableMappings.Add("Table1", "orders");
da.Fill(dataSet1);
DataRelation relation = new DataRelation("employeeorders", dataSet1.Tables[0].Columns["employeeid"], dataSet1.Tables[1].Columns["employeeid"]);
dataSet1.Relations.Add(relation);
dataGridView1.DataBindings.Add("datasouce", dataSet1, "employees");
}
}
}
|
|
|
|
|
Well I'd rather use a typed dataset for this. Its makes it alot easier for u
And dont combine both queries in one string. Just makea typed dataset and then just fill both tables with the TableAdapter.Fill method and add the relation to teh DatagridView
hope it helps
Rocky
|
|
|
|
|
Ok thanks, I'll try this, but I'm just a beginner at ADO.NET so I may come back here for help if I have misunderstood what you mean.
|
|
|
|
|
ok surething
|
|
|
|
|
string strConnect = @"server = (local)\SQLEXPRESS; integrated security = sspi; database = C:\SQL\NORTHWND.MDF";
string strQuery1 = @"SELECT * FROM employees";
string strQuery2 = @"SELECT * FROM orders";
string strQuery = strQuery1 + strQuery2;
SqlConnection conn = new SqlConnection(strConnect);
SqlDataAdapter da = new SqlDataAdapter(strQuery, conn);
When you add the strings :
strQuery = strQuery1 + strQuery2;
here the strQuery becomes:
"SELECT * FROM employeesSELECT * FROM orders"
and you can see this is an invalid query , so it results in error.
Regards,
Sushant Duggal.
|
|
|
|
|
hi every buddy
well I'm trying to make a few queries to make reports of my project here and I wana grup the data according to months, or weeks or years
So I'm writing a query which is like
<br />
<br />
select m.manname+' '+prod.name as Item, SUM(s.salePrice) Total_Sale, dateName(month, b.billdate)+', '+datename(year,b.billdate) as sale_Month<br />
from sale s inner join purch p on s.purchid = p.purchid<br />
inner join manufacturer on p.manid = m.manid<br />
inner join products prod on p.catid = prod.catid<br />
inner join bill b on s.billid = b.billid<br />
group by m.manname+' '+prod.name, dateName(month, b.billdate)+', '+datename(year,b.billdate)<br />
<br />
So can u plz tell me how can we make groupings so that I can get seperate records for November 2007, December 2007 and so on u so forth u know.
thanks in advance
Rocky
|
|
|
|