|
How to pass NULL for the Image Datatype in SQL Server. For example we pass Null to int, string etc. Please tell me how is this possible for Image.
|
|
|
|
|
You can try using the System.DBNull class. It has a property Value which represents a NULL value in the database. It would be like that:
myDBVariable = DBNull.Value;
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
In a stored procedure I inserted the datas thro' parameters. In the parameter I have to insert the column name; I need to change the column name dynamically for each time in insert the value in the parameter so that I can sort various columns. I tried to use the below method but couldn't. Can anyone help me out.
create proc sortTable @column varchar(10),@direction varchar(5) as
declare @type varchar(5)
set @type = @direction
if @type = 'asc'
select * from tblname order by @column asc
else
select * from tblname order by @column desc
Regards,
LEE
|
|
|
|
|
You would need to turn your select statement into a string and then execute it, e.g.
declare @sql nvarchar(400)
set @sql = 'select * from tblname order by ' + @column + ' ' + @type
exec (@sql) I really don't like doing this, but if it's what you need to do...
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Im agree with Pete.
If the table dont have many columns you can make a SqL BY any Column whith different sort. But this no mantenible for futures develops.
I have to work with a lot dynamic sentences, i suggest dont use "*" and before you put this sentence into a procedure run execute plan to watch the behavior
|
|
|
|
|
Hi,
After my SELECT I have the following results (partially here):
ID Name ParentID
256 Language, Literature And Biography 2878
257 Language & Linguistics 256
258 Philosophy Of Language 257
261 Language Acquisition 260
267 Language Family Studies 263
289 Language Usage Guides 284
292 Language Teaching & Learning (other Than ELT) 256
293 Language Teaching Theory & Methods 292
294 Language Teaching & Learning Material & Coursework 292
(please excuse if this is not properly aligned)
I thought about using the dataset's Relations property, like:
ds.Relations.Add("NodeRelation", ds.Tables(0).Columns("ID"), ds.Tables(0).Columns("ParentID"))
..but I get errors if there is no link between and ID and ParentID. How else can I do this??
Please help.
Regards
ma se
|
|
|
|
|
Please explain. What exactly are you trying to do and what is not working? What is your select statement? We need more information to help you.
|
|
|
|
|
Hi,
I am developing an application using Visual studio 2005 and sqlEXPRESS 2005(both are installed in my machine). My problem is i can connect to sqlexpress via visual studio. I think it does not accept my connection string which is:
"Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword";
for myServerAddress if i wrote localhost\SQLEXPRESS C# doest not like the '\'.
If someone i have an idea ?
Thank you
|
|
|
|
|
try localhost\\SQLEXPRESS
I Love SQL
|
|
|
|
|
|
hi all
how many max connection to a database in sqlserver ??
|
|
|
|
|
Please make question more sensitive.
And try to make a google[^]search
I Love SQL
|
|
|
|
|
Hello,
32767 concurrent connections are allowed in SQL 2000.
Senthil S
Software Engineer
|
|
|
|
|
How can i show a crystlreport in vb program
|
|
|
|
|
You couldn't have picked a more inappropriate forum could you? I doubt there are many people here who have active VB6 skills.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: I doubt there are many people here who have active VB6 skills.
Some of us have to still maintain legacy code for clients who won't (or can't) upgrade...
|
|
|
|
|
But, out of the 4,382,390 members, how many are going to admit to having VB skills and how many actually look at the forums.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: how many are going to admit to having VB skills
Why not?? anybody can do VB...
|
|
|
|
|
Go on - post this as a survey question, and see how many admit to currently coding in VB/
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Go on - post this as a survey question, and see how many admit to currently coding in VB/
I did not say people would admit to doing it, I just said anybody _could_
|
|
|
|
|
Maybe, but they don't do that a SQL forum. They would do that in a VB forum.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Colin Angus Mackay wrote: Maybe, but they don't do that a SQL forum. They would do that in a VB forum
You are right... precisely the reason I was only replying to Pete and not the OP.
|
|
|
|
|
may be following links helpful to u.
http://visualbasic.ittoolbox.com/documents/popular-q-and-a/viewing-a-crystal-report-using-vb-3386
http://www.freevbcode.com/ShowCode.asp?ID=4832
|
|
|
|
|
hello
I have two related table
table1
cId
cDesc
table2
Id
Name
phone
cId
These two tables are related
where cId in table 1 is primary key and cId in table2 is foreign key
If I want to delete a record in table 1 which is related to table 2
Which is faster and more accurate
should I write my stored procedure like this
if exists(select * from table2 where cID = @CID)
delete from table1 where cID = @CID
else
return 0
------------------------------------------
or
------------------------------------------
delete from table1 where cID = @CID
if @@error<>0
return 0
|
|
|
|
|
If exists is a pretty slow approach. If you really wanted to do a select statement first you should do something like this:
if (select count(cID) from table2 where cID = @CID) > 0
begin
delete from table1 where cID = @CID
end
You probably don't want to do blind deletes since you may incur some locks that you don't really need if the row isn't there.
Hope that helps.
Ben
|
|
|
|