|
i inserted the ado data control in my form and went to propertes as usual with the Ado data control, and Build connection string, and choose SQl server a driver and where am supposed to choose my Sql server it gives me an Error.
"Error Enumerating data servers.Enumarator reports 'unspecified error'"
help what would be the problem
Vuyiswa
|
|
|
|
|
how to insert null into datetime field in sql??
can i assign it from asp.net..
pls explain..
thks
|
|
|
|
|
use DBNull.Value
i.e dr["ColDate"] = DBNull.Value
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
How can get the path of a database(.mdb)and name of the tables in that .mdb file?
thanks
|
|
|
|
|
Please help i've many forms inserting to DB SQL
i want to implement a method that reads directly from the Datatable and insert or delete directly to the DB instead of providing the parameters manually.
the update is easy just provide the to the adapter.update()the datatable and it automatically do it
but the insert and delte of the adapter u must provide the paremeters manually.
so did any body though about this before ????
i hope it can works.
|
|
|
|
|
simsem wrote: the insert and delte of the adapter u must provide the paremeters manually.
No you don't. After you create the DataAdapter, you can use an OleDbCommandBuilder or SqlCommandBuilder to create the INSERT, UPDATE and DELETE commands for that adapter. Well, so long as the SELECT is a single table query that is...
Docs on the SqlCommandBuilder are here[^].
|
|
|
|
|
Hi chaps, i have a question.
Is it possible to somehow combine a collection of commands to read out as the same DbReader, and just iterate through the batches in the DbReader object?
Being able to return multiple sets is REALLY useful, and it would be nice if i could construct say 3 commands, to select the contents of multiple tables, execute them all together into one DbReader, and generate the objects for each result set without consecutive db calls.
Are there any options like this? Or would i have to use stored procs?
Cheers
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
This is possible, but not with Access. Access doesn't support batch queries like SQL Server does.
It's easy to find examples. All you have to do is Google for "VB.NET SqlDataReader multiple result sets".
|
|
|
|
|
Hi Dave, thanks
I have the multiple result sets, but what i'm looking for is the ability to box up multiple DbCommand objects and send them off all in the same query, and return a DbReader with a result set for each of the supplied commands.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Tristan Rhodes wrote: i'm looking for is the ability to box up multiple DbCommand objects and send them off all in the same query, and return a DbReader with a result set for each of the supplied commands.
There's no way to do that. You can only send off each one by itself and get a seperate dbreader for each result.
|
|
|
|
|
I suppose i have a bit of a brain block with databases.
I always get mixed up over what is physicaly fast / slow and what's worth using when, and in what situations. They are a complex beast and i'm trying to cram in as much experience with them as possible. But i still feel there is a fundamentaly different way of handling things depending on the situation, single site web app, distributed web app, client DT application etc. Then there is concurrency and caching, and the nature of the application.
I've only been using databases for about a year and a half, please tell me it gets easier with time / experience
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Tristan Rhodes wrote: please tell me it gets easier with time / experience
Yeah, right!
The point behind solving problems is not to know how to solve the same problem again later. It's learning how to research any problem you encounter. The more you do this, the easier it gets to find an answer to the next problem.
|
|
|
|
|
Hello,
SQL 2005
I have a stored procedure and I am not sure I wrote it correctly to except a parameter of ticketid.
In VS I can see the fields however no data gets passed.
When I select query builder from VS I get an error "unable to parse query text"
I then exceute query and the fields show up with no data.
If I set the Parameter @ticketid to a value it works in SQL Query Analyser.
In the command and editor window in VS-? under parameters I have ticketid value request.querystring ("@ticketid")
Query String Field = @ticketid
here is the stored procedure:
Declare @ticketid as varchar (20)
Declare @Technician as varchar (20)
set @Technician=(SELECT email
FROM dbo.tech INNER JOIN dbo.job_ticket ON tech.client_id = job_ticket.assigned_tech_id WHERE job_ticket.job_ticket_id =Cast (@ticketid as varchar (20)))
SELECT job_ticket.job_ticket_id 'Ticket Number', @Technician 'Technician Assigned',job_ticket.subject 'Issue Description', report_date 'Open Date',tech_note.note_text 'Work Notes'
FROM job_ticket INNER JOIN dbo.tech_note ON tech_note.job_ticket_Id = job_ticket.job_ticket_id WHERE job_ticket.job_ticket_id =Cast (@ticketid as varchar (20))
Am I not passing the varible correctly or is the stored procedure incorrect?
Any help is greatly appreciated; I have been stuck on this for days.
Thanks
Regards,
Hulicat
|
|
|
|
|
okay so it needed to be created as......
question what does this do as oppsoed to how I had it:
CREATE PROCEDURE dbo.sp_dticket
(
@ticketid as varchar(20)
)
AS
CREATE PROCEDURE dbo.sp_dticket
(
@ticketid as varchar(20)
)
AS
Declare @Technician as varchar (20)
set @Technician=(SELECT email
FROM dbo.tech INNER JOIN dbo.job_ticket ON tech.client_id =
job_ticket.assigned_tech_id WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20)))
SELECT job_ticket.job_ticket_id 'Ticket Number', @Technician
'Technician Assigned',job_ticket.subject 'Issue Description',
report_date 'Open Date',tech_note.note_text 'Work Notes'
FROM job_ticket INNER JOIN dbo.tech_note ON tech_note.job_ticket_Id =
job_ticket.job_ticket_id WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20))
GO
Regards,
Hulicat
|
|
|
|
|
Dear i it is not necassry to CAST the value if u have int type Value. Query gives the result. if u send me Table structure thean i will solve you clearliry.
Thanks and Have a Nice day
|
|
|
|
|
It kept throwing an error unable to convert varchar to int...even when it was declared as int....so I dropped in the cast and it worked.
I was just wonding what is different about putting the varible in brackets before the "AS"?
It's working correctly; I would just like to better undersrand how
Thanks,
Regards,
Hulicat
|
|
|
|
|
I want to allow users to create filters by typing in a textbox the filter they wish to apply to any particular column. I want to apply the filter as the user types it, and I want to apply it as if the displayed value were a string. For example, if I have data with numbers 0-23 associated with it, and a user types the number 1, all data with numbers 1 or 10-19 should still be displayed. So essentially, I want to apply the filter expression "[ID] LIKE '1%'", but when I do this I get the error "Cannot perform 'Like' operation on System.Int64 and System.String". How can I prevent this error without making the filter string something like "[ID] = 1 OR ([ID] >= 10 AND [ID] < 20) OR ([ID] >= 100 AND [ID] < 200) OR ..." (because that would get out of hand)? Thanks.
-Jeff
|
|
|
|
|
Do not post in multiple forums
|
|
|
|
|
Dear Just Convert the Value Into string in Presentation or coding. and if you used a stored procedure then parameter data type set is nvarchar.
then it is working
|
|
|
|
|
hi all
could i insert an evaluated expression in the isnull function ??
example:
select pag_id ,exp,
temp_col = case when isnull(exp, 0)=1 then 0 else 5+3 end
from page_loc
/*
@ the above query is what i want to do, but the expression inside the
isnull function give a syntax error.
@ exp1 = (select sum(sub_pages_count) from vw_page_loc where pag_lang='en')
@ please ignor the logic
*/
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Yes you can! Check out your expression!
If failed again try out the coalesce function.
Gautham
|
|
|
|
|
what is the Difference between this two using datagrid in vb6
Dim rs As New ADODB.Recordset
dim rs new recordset
thanks
Vuyiswa
|
|
|
|
|
No difference.
in first case u give the exact refernce when u dont import ADODB namespace/Class
in other case u import the ADODB and now used recordset
|
|
|
|
|
Thank you man,sory i did not reply earlier, i was in a meeting
Vuyiswa
|
|
|
|
|
hey guys...
is there any way to speed up(force) the database restoring..plz tell me the syntax...
|
|
|
|