|
<br />
Select Company,... from nhanvien where company is NOT NULL<br />
Union<br />
Select Company,... from nhanvien where company is NULL<br />
order by Company ASC<br />
<br />
This wont quite accomplish what you wan, the null values will sort to the top, not the bottom, but at least the non-null values will be sorted a-z for you.
an alternative would be to do this in two steps:
selecting all the not-null records first:
<br />
Select Company,... from nhanvien where company is NOT NULL order by company ASC<br />
and add the records to the combo box
then add the remaining values with a second query not sorted
<br />
Select Company,... from nhanvien where company is NULL <br />
and add the results to the combo (don't clear the first set of results)
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
|
|
|
|
|
hi all,
i am facing a prob lem in accessing database over network.
i should elaborate the problem bit more
look if use the connection string as below then it works fine,
"PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\xyz\abc.mdb;"
but when i try to use it as
"PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\webbdv\jkl\mmm.mdb;"
where webbdv is computer name which is residing on network and not my local machine then application gives error
'Disk or Network Error'
hopefully you are having answer for this question waiting for your reply
thnking in anticipation
neoms21
|
|
|
|
|
The most obvious question is, can you see that folder on your network from that machine, without having to log in to it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
yes i can see that folder even access them and edit i am having all security privilleges.
but when ran in application it doesn't get access.
|
|
|
|
|
The user that your site runs under needs access. When you're browsing, you're not doing it as that user. How is the site written ( asp/asp.net/etc ? ). Do you know the user your site runs as ? Does IIS allow anonymous access ( if so, you're probably running as an anonymous user ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
yes IIS allows anonymous access.
and my site http://webbdv/firstpage.aspx
|
|
|
|
|
i have data in bulk in Txtfile delimited by commas and row by CR, I want to iport this data into my msSQL server "PS101" , Database = "RAW_MSG", Table name = "RAW_MESSAGE".
how can i do it please help....i am new to C#....i have to do it through console programming...can anyone give a lead by how to connect to server and bulk import a data and fill the database.
thanks for anyhelp
in advance
Bose
|
|
|
|
|
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.
|
|
|
|