|
I have searched hi and low for my answer with no success. The dataadapter design gives you a way to create multiple queries. (Fill, Fillby, Update, etc.) But, I don't wan to use the designer. I want to code it all. I have the fill. That was easy. How do I create a query method using code.
Reason:
In one part on my program I am getting data from a database and binding it to a datagrid. At one point I want only certain records to show. At other times I want all records to show.
I want to be able to code like this:
if certainFlag = "true" then<br />
adapter.fill(datatable)<br />
else<br />
adapter.allfill(datatable)<br />
endif
How would I code the allfill query?
|
|
|
|
|
there is no such option in "adapter.allfill", check once.
|
|
|
|
|
Are you saying that I can't create a query using code? I can do it using the designer. I created one called insertRecord. I want to create one NOT using the designer but using code.
|
|
|
|
|
Is there anyway to Pad Left a string in SQL for MS Access? Or to retrieve a numeric field with zeros in any empty place markers? For example, I have a numeric field of size (3, 0) and if it contains the number 1 I want it to return 001. I've searched but not found anything for MS Access that seems to work.
Any help/advice would be appreciated.
|
|
|
|
|
Try:
Right('000' & MyNumberField, 3)
Regards
Andy
|
|
|
|
|
Thank you thank you thank you!
I've been circling around and around searching for the past few hours.
|
|
|
|
|
That's a very neat way of doing it.
You always pass failure on the way to success.
|
|
|
|
|
Hi
Within an update trigger I am trying to get the value of the primary key of the row that fired the trigger. I can't select the primary key using any of the other columns either since the other columns may be duplicated in rows other than the one that fired the trigger.
Thanks
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
If you are using Sql Server, you can select the value from the deleted table in your trigger. Trust me - it sounds strange, but it does work.
|
|
|
|
|
Thanks,
That worked
Cheers
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Does anybody know if it is possible to change the name of the column in the subscribers table when using Snapshot Replication?
|
|
|
|
|
Don't know. Have you tried it?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I'm trying to replicate a database from SQL Server 2005 to SQL Server 2000, while creating a new Subscription when I try to add a subscriber server the following error message is displayed.
TITLE: Connect to Server
ADDITIONAL INFORMATION:
Failed to connect to server BERN. (Microsoft.SqlServer.ConnectionInfo)
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)
I did Googleing but I could not find a suitable solution, please help me out. I will be grateful to you.
Sami.
|
|
|
|
|
Are you able to connect to the remote server using management studio? (by openning a new database query window)
|
|
|
|
|
Hi,
My backend is MSAccess. I have a table which contains a field 'return date' which is DateTime. I want to subtract the return date from the current date in the query.This should be done only between dates and not time.
|
|
|
|
|
Hi,
You can do this in the following manner.
---------------------------------------------------------------------------
BEGIN CODE
Dim d1, d2 As Date
Dim diff As Long
d1 = Date.Parse(CurrentDate)
d2 = Date.Parse(ReturnDate.Text)
diff = DateDiff(DateInterval.Day, d1, d2)
END CODE
---------------------------------------------------------------------------
This code will return the days only.
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
i google the net but i did't fined any simple project about how to save an image in sql 2000 using C# language.
Plz just how can i comver the image file to byte string.
Help me out just put a link or small chunk of code.
|
|
|
|
|
Naveed khan nido wrote: i google the net but i did't fined any simple project about how to save an image in sql 2000 using C# language.
I also did a search and found the following results[^] in about 5 seconds.
What were you searching for?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Actually i got the results but that are difficult in sql, i just want to save only pic not much information about it.
I just need simple code.
|
|
|
|
|
Naveed khan nido wrote: I just need simple code.
One of the skills a developer needs to possess is the ability to undertake research to find the solution to a problem. It is unlikely that you will succeed in your chosen career if you ask people to do your work for you, despite having been given advice and pointed towards sample code.
Read the articles I suggested again, attempt to solve the problem yourself using the samples provided and post again if you have any further questions. If you want someone to do your work for you, I'm afraid you've come to the wrong place.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
hi there,
i want to set password on my database of SQL server 2005, can someone tell how can i do this?
thanks
Becoming Programmer...
|
|
|
|
|
xmen wrote: i want to set password on my database of SQL server 2005, can someone tell how can i do this?
You don't set a password on the database itself. You set a password for a user account that can access the database. If you create a new user account from SQL Server Management Studio, you will be prompted to select the method of authentication this account will use (Windows/SQL). If you select SQL authentication, you can define a password for the account. User accounts can also be created from T-SQL, but I don't know the syntax of the top of my head. Search the MSDN documentation if you want to know more.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Actually, it is a two stage process and it isn't a "user account" exactly. You first of all set a login on the server. You then go around each database that login is to have access to and create a user for the database and associate it with the login.
|
|
|
|
|
Oh yes I remember that on our servers - thats the 'sa' login with a password of 'administrator'
You always pass failure on the way to success.
|
|
|
|