|
hi everyone,
i'm new with this software. i have installed it and i think i was able to install it successfully. but i'm wondering it seems to me this 2005 version was not installed since i don't see any difference between this and the 2000 version. when i opened the "Books online" it says there Ms Sql Server 2000. that does mean the 2005 developer edition wasn't installed?
I will really appreciate any help!
|
|
|
|
|
Hi all
We have an application written in VB.Net.It crashes (without showing a message or something) whenever we try to fill a dataset using a DataAdapter (any type of data adapter) with huge data under microsoft windows 98 (Our RDBMS is Microsoft SQL Server 2000)
Does anybody know what is the reason? and what should we do to prevent the crash?
Please help me.
Thanking you in advance
|
|
|
|
|
|
win form has few textbox, i wana store data in table using DataAdapter.insertcommand.
I create Oledb.command object named Icmd then i store SQL "insert into Table" String then i write as follow, it did't give me any error but it cannot work.
DataAdapter.insertcommand = Icmd
If anybody has WinForm simple data entry module, so send me files then i can study myself.
thank you
|
|
|
|
|
Hi everyone,
I am attempting to read records from a table based on a date range, however, the dates are stored in a varchar field. The format of the date is 2005-09-01 10:50:00.
How can I get around the fact that the vendor used the wrong data type?
Your help is greatly appreciated.
|
|
|
|
|
Depends on what daabase you are using. If it's MSSQL you could cast/convert the varchar to a date before comparing it in the query:
select * from [PoorlyDesignedTable] where Cast([ShouldBeADateTimeField] as Datetime) = MyDate
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Rob thanks for your quick response!
Yes it is MSSQL 2000.
Now please pardon my ignorance, but, if I have records with dates greater than 9/1/05, the following statement should return all those records rigt?
SELECT field7, field13, field14<br />
FROM myTable<br />
WHERE (CAST(field14 AS Datetime) >= '2005-09-01') AND (field7 = 'Work Order')
But my result set is empty.
What am I missing?
|
|
|
|
|
SQL Server will return those records for which
CAST(field14 AS Datetime) is greather than '2005-09-01' only if value for filed7 is equal with 'Work Order'
Your result may be empty if settings for database COLLATION or field7 COLLATION is case sensitive CS.
Try to use this condition: ... AND UPPER(field7) = 'WORK ORDER'
Be attention at spaces between WORK and ORDER !
Also, the condition for date may be rewrite thus:
MONTH( field4 ) >= 9 AND YEAR( field4 ) >= 2005
|
|
|
|
|
Thanks everyone for your help!
I ended up using the following statement:
WHERE (UPPER(field7) = 'WORK ORDER') AND (field14 BETWEEN @startdate AND @enddate)
Following airbus' suggestion to use UPPER , and documentation I found in SQL Sever Bible
Thanks again!
|
|
|
|
|
What is datetime format setting for your server ?
Use DBCC USEROPTIONS in SQL Analyzer !
VB6,C#
|
|
|
|
|
If all the values from field4 are in Y-M-D HH:MM format then SQL Server will implicit conversion VARCHAR field to DATETIME.
|
|
|
|
|
See
SQL Server Books Online
topic: CAST and CONVERT
|
|
|
|
|
Hi,
One of my stored procedure returns a string, which is the combination of fields like 'Ship Name : Ship1 Port Name : Port1 City : London' and I want show this data in my Asp.Net page i.e in TextArea control as follows (i.e in multiline).
Ship Name : Ship1
Port Name : Port1
City : London.
I am adding the '\n' charector after each value like.
'Ship Name : Ship1 :XYZ \n Port Name : Port1 \n City : London'.
And in C# i am using Server.HtmlDecode, but it is not working how can I display the data in multiline.
Regards,
Kalyan
|
|
|
|
|
Hi Kaylan
instead using the '\n' character use Environment.NewLine . This should help.
Regards
Sebastian
|
|
|
|
|
|
Try '\r\n' in place of '\n', May it solve your problem
love2code
|
|
|
|
|
Hi, i am new to ado.net so soory, if it seems like a stupid question.
I have filled a datatable with data by a simple query.
i have a datagrid, which doesn't need to show all the columns of the table,
how can i show only some of the columns without needing to query again?
can a dataview show parts of the datatable i have?
thanks,
Nir.
|
|
|
|
|
Hi Nir,
what kind of datagrid do you use (the one for WebApplications or the one for WindowsApplication)?
1) for WebApplications:
just do a right click on your DataGrid and select PropertyBuilder and then add all columns
that should be mapped and displayed
2) for WindowsApplications:
use the property TableStyle. This property defines, like the one for datagrids within WebApplications,
which columns should be mapped and displayed.
If you have any further questions don't hesitate to post again.
Regards
Sebastian
|
|
|
|
|
Also, make sure the auto create columns property is set to false. Otherwise the datagrid will contain all columns in the datatable plus those you added as above.
|
|
|
|
|
thanks for the quick reply,
I'm using WindowsApplication and the datagrid is filled at run time.
i have a function which executes a query and return datatable
this datatable (some columns of this table) should be the datasource for the datagrid.
I tried to use the TableStyle like this whit no success
QueryStr = QueryStr + "select * from Trainee "
DT = db.selectQuery(QueryStr) ' returns datatable
Dim TS As New DataGridTableStyle
Dim CS As New DataGridTextBoxColumn
TS.MappingName = "UpdateTable"
CS = New DataGridTextBoxColumn
CS.MappingName = "FirstName"
CS.Width = 50
TS.GridColumnStyles.Add(CS)
CS = New DataGridTextBoxColumn
CS.MappingName = "LastName"
CS.Width = 50
TS.GridColumnStyles.Add(CS)
CS = New DataGridTextBoxColumn
CS.MappingName = "ID"
CS.Width = 50
TS.GridColumnStyles.Add(CS)
CS = New DataGridTextBoxColumn
CS.MappingName = "Mobile"
CS.Width = 50
TS.GridColumnStyles.Add(CS)
UpdateGrid.TableStyles.Add(TS)
UpdateGrid.DataSource = DT
how shpuld i connect the datasource?
thanks
nir.
|
|
|
|
|
Hi Nir,
look at the message from mark to turn autocreatecolumn off and be sure that you only add those columns to the tablestyle that should be displayed. Did you named the datatable like the mapping name of the table style ('UpdateTable')? Try to use a UpdateGrid.DataBind() to be sure that data will be binded to the grid.
Please let me know if this hint had helped you.
Regards,
Sebastian
|
|
|
|
|
Thanks for your help, it worked.
|
|
|
|
|
Clear the tablestyle first and then add the new tablestyle. Dont create DataGridTextBoxColumn for the columns you dont want to display. If you want I can send you a small sample.
|
|
|
|
|
Thanks for your help, i managed to create the table style.
nir.
|
|
|
|
|
I have a list box which shows the tables in the database.I don't want to show the real table name instead an alias for those tables names should go how this can be done
|
|
|
|