|
In the DataGrid ? An ASP.NET DataGrid ? o a Windows Forms DataGrid ? In any case, you can set a Format or FormatExpression property for the column (in your app, not in the database). Set the format to "D" to use the long date pattern. See here[^]
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
help any one help me ,by giving code to store an image in database directly from system.i mean a image that is in our system ,should uploaded into the database.
live and let live
|
|
|
|
|
Hi all,
I am using dynamic sql in my stored procedure. There is a problem. There are parameters in the dynamic sql query which are of type int or rather which are not of string type. So it is giving me error saying cannot convert type string to int.
Can anyone help me out of this?
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links
|
|
|
|
|
hello
p
|
|
|
|
|
|
Look in the SQL Server documentation for CAST or CONVERT
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hello All,
I've downloaded and installed SQL 2005 Express a week ago. Now, I've downloaded the SQL 2005 Management Studio Express. It complains that it only works with SQL 2000 and SQL 2005. Am I stuck with sqlcmd.exe for creating databases in SQL 2005 Express?
Any help is appreciated.
Paul
|
|
|
|
|
It so turns out that I installed a version of SQL 2005 Express from October, and Management Studio Express needed the latest release from Microsoft.
So I've got it working now
|
|
|
|
|
I inserted three records into table Products(ProductID, ProductName) with ProductID set to AutoIncrement.
Three records with ProductID were 1, 2, 3.
After that i deleted three recored and insert the fourth record. This record would got the the productID's value is 4
How could i set the ProdudctID of this record to 1, just like the beginning.
Thanks
|
|
|
|
|
vuthaianh wrote: How could i set the ProdudctID of this record to 1, just like the beginning.
I’m guessing you’re using MS Access; the only way to re-start the counter is to compact / repair the database. It only works when there are no other data connections open and when no records exist in the table.
Hope this helps.
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Hi All,
Thanku for ur quick n speedy response................
Here I came with a question......
I have table called -- Client
a column is there that is --- clientCode navarchar(15)
Another table user_ref
in this I have UserID as primary key...
Now wht i have to do is I have to get clientCode from Client table to user_ref table and
I have to make (userID,clientCode) as primary key.
hope u all got the query
pls tell me ASAP
thanku
sangeetha
sangeetha
|
|
|
|
|
|
I'm making assumptions here it not very clear what you require
Run an update with two tables :
-------------------------------
update user_ref
SET user_ref.clientCode = Client.clientCode
from user_ref client
WHERE user_ref.USERID = Client.USERID
|
|
|
|
|
I have this:
With Me.daNumCourses.SelectCommand
.CommandText = "SELECT Section.Section_ID, Section.InstructorID, Instructor.ID FROM Section INNER JOIN Instructor ON Section.InstructorID = Instructor.ID AND Section.InstructorID = '" & Me.instr.ID & "'"
intCount = .ExecuteNonQuery()
End With
Me.dsNumCourses.Clear()
Me.daNumCourses.Fill(Me.dsNumCourses)
Me.txtNumberCourse.Text = intCount
I keep getting -1 so what am I doing wrong?
Thanks
|
|
|
|
|
Why are you doing this? Why not just fill the data set and get a count of the rows in the DataTable? e.g. dsNumCourses.Tables[0].Rows.Count
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
I just want to get the count of the classes that a certain instructor teaches. I tried the .count property and that counts all of the rows in a particular table.
Thanks for your reply. If you have a suggestion on how to do that please post back.
|
|
|
|
|
Why don't you have your SQL as:
SELECT COUNT(*) FROM ....
Also, the way you build your SQL is suscepatable to a SQL Injection Attack and you should try and use parameterised queries where ever possible. You can read more on how to improve the security of your application here: SQL Injection attacks and tips on how to prevent them[^]
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
How do you return the number of rows from the query? In other words if I have a variable intCount how do I set intCount to the "count" of the query?
Thanks for your reply. We've noticed a few security holes in our application in a few places and we are fixing those right now.
|
|
|
|
|
Dim cmd As SqlCommand
cmd = SqlCommand.New()
cmd.CommandText = "SELECT COUNT(*) FROM MyTable WHERE someColumn=@someValue"
cmd.Connection = myConnection
Dim numRows As Int
numRows = cmd.ExecuteScalar()
numRows will contain the number of rows that match the given filter (i.e. what is filtered in the WHERE clause). COUNT() is an aggregate function that returns a count, when COUNT(*) is used it returns the number of rows. If you use COUNT(columnName) then it will count the number of rows where the column value is not null.
Does this help?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
This is the correct way. ExecuteNonQuery should be used for Insert/Update/Delete statements. If the CommandText is "SELECT" statment, then it will always return -1. When it is DML statement, then it will return the number of rows affected by that DML statement.
|
|
|
|
|
I have a program that converts excel to mssql. Does anyone know how to properly use it step-by-step?
|
|
|
|
|
vandread1 wrote: I have a program that converts excel to mssql. Does anyone know how to properly use it step-by-step?
I think you win the prize for the most vague question of the day.
vandread1 wrote: a program
"A program"? The indefinite article? Could you tell us to which program you are referring?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
vandread1 wrote: I have a program that converts excel to mssql. Does anyone know how to properly use it step-by-step?
Peers over your screen looks, I don’t see any program running that converts an Excel file to SQL server.
Is that you need to create a program that inserts data into a SQL table? What language are you planning on using? Which data connectivity model do you need to use?
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Please im working on smart devices application on C# and i want to know how i can connect a database with it as the windows application.
im trying to use Using System.data.oledb
or Using System.data.sql
But no response.
so please please help me.
thanx and wish u solve me this problem
tedy
|
|
|
|
|
Follow this
http://www.csharphelp.com/archives3/archive586.html
Hope this helps
|
|
|
|