|
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
|
|
|
|
|
|
instead of ....
group by m.manname+' '+prod.name, dateName(month, b.billdate)+', '+datename(year,b.billdate)
try ....
group by dateName(month, b.billdate)+', '+datename(year,b.billdate), m.manname+' '+prod.name
I'm not sure if the answer is that easy but it looks that way to me.
|
|
|
|
|
ok I"ll try that as well but I'm also looking in to date part too
|
|
|
|
|
I got the grouping when i use date part and seperate the month and year now but still I cant get it like a single string 'November 2007'
I have a bit awkward idea to make another view over it and concatenate those month and year columns in that
Rocky
|
|
|
|
|
If you have it grouping correctly is the problem what is getting displayed?
I did a query like below on an example table and the grouping seems to be working and so does the display:
select count(1), max(dateName(month, invcDate)+', '+datename(year,invcDate))
from invc
group by dateName(month, invcnbr)+', '+datename(year,invcnbr)
I had to add the max around the month string since it wasn't an aggregate, but it displays and groups.
|
|
|
|
|
well I made grouping with another idea u knwo.
I make a view like (name: my_view)
select m.manname+' '+prod.name item ,SUM(s.saleprice) total_sale, dateName(month, billdate) mnth, datename(year,billdate) yr from sale inner join bill on s.billid = b.billid group by dateName(month, billdate), datename(year,billdate), m.manname+' '+prod.name etc
and later I make a query on it like
select Item, total_sale, mnth+', '+yr from myView
Atfirst i used inline view for this but then I converted it into a seperate view. and now its groupin it correctly
But do u have any ideas on grouping on a weekly basis ?
Rocky
|
|
|
|
|
Hi All,
Desperately need some help, guidance and wisdom that I am pretty sure only you can give. I am trying to do some fancy pattern matching, however I am not sure if it is even possible in SQL.
Im trying to create an expert system, where the user can go online and self-diagnose their problem by typing it in to a textbox. The input from this textbox is then stored to a String variable. What I want to do is match any part of this input with any part of a stored Call Log Description (which is a field from the database).
For example;
User Input: "blah blah blah...I want to tell you that I am happy...blah blah blah"
Within Database: "blah blah blah...I am happy today as I...blah blah blah"
Result: "I am happy" pattern match has been found!
Is it possible to create an SQL statement to match part of a sentence with another part of a sentence?
Many thanks
Richard Powell
|
|
|
|
|
try using SUBSTRING() function in where clause with like operator for pattern searching.
KP
|
|
|
|
|
hello
i'm woring on the Create trigger query (for insert, update and delete)and it doesn't work.
the syantax i'm using is
Global.Instance.Trigger_Query="CREATE TRIGGER "+Global.Instance.Field_Name+"_trg ON "+ Global.Instance.Table_Name+" FOR INSERT AS "+Global.Instance.Field_Name+" + "+val+" GO";<br />
i got the syntax from the link that was suggested by another fellow developer earlier through the forum, but i've also tried many other syntaxes but not one of them is working.
please tell me what the problem is
awaiting ur replies
regards
Saira
-- modified at 9:04 Saturday 10th February, 2007
|
|
|
|