|
Sir
Used TCP/IP port 1433 in de connection string and its working only for .NET 2003, when i used de same thing in .NET 2005 it shows me an error like this
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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it
|
|
|
|
|
|
Hello All,
I am using a SqlDataSource with a GridView on a ASP.NET 2005 page. I have a DropDownList (control parameter {0} ) and a TextBox (control parameter {1} ). The user picks the field they want to search in the DropDownList and then types in a search into the TextBox and it doesn't appear to like the use of LIKE in the SqlDataSource 's FilterExpression property; i.e.
SqlDataSource1.FilterExpression = "{0} LIKE '{1}'"; produces a filter that searches on EXACT MATCHes only instead of STARTS WITH like the docs say. What would be ideal for my requirements is a CONTAINS search, really. I know I could use CharIndex -- at least in an explicit WHERE clause -- however, putting FilterExpression="CharIndex('{1}',{0})>0) raises a System.Data.EvaluateException: The expression contains undefined function call CharIndex() error.
Any hints? Thanks in advance.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
You need to use wildcard characters if you don't want to find an exact match.
The % wildcard matches zero or more characters. If you change your code to
SqlDataSource1.FilterExpression = "{0} LIKE '{1}%'";
you will get records that start with the specified sequence rather than exactly matching it.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I have the need for a database that has a large number of fields and would be accessable via ASP.NET Web page.
The table would center around locations;
Fort Worth, Topeka, etc.
Each location has up to 28 Backup Batteries that require a semi-annual inspection;
This inspection includes Voltage, Conductance, Tempreture, and Voltage with the charger off.
A number of true/false quesiton are also associated to the inspection.
Would it be best to create four tables for the Backup Batteries, another for the locations and quesitons, and then create a relationship with the Locations table for everything else?
Or would it be smarter to just create one gigantic table that has upwards of 130 columns?
Thanks,
|
|
|
|
|
Off the top of my head, the following tables should be sufficient:
1. Table to store locations
2. Table to store types of inspection check e.g. Voltage, Temperature
3. Table to store inspection questions
4. Table to store location/battery combinations
5. Table to store location/inspection instance combinations
5. Table to store location/inspection instance/battery/inspection check result combinations
6. Table to store location/inspection instance/inspection question result combinations
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi Paul, would I need to have a common Primary Key field for each one? and then would I also need to "join" them?
Thanks,
|
|
|
|
|
The primary keys for the tables would look like this:
1. LocationID
2. InspectionCheckItemID
3. InspectionQuestionID
4. LocationID | BatteryID
5. LocationID | InspectionID
6. LocationID | InspectionID | BatteryID | InspectionCheckItemID
7. LocationID | InspectionID | InspectionQuestionID
You should also consider setting up referential integrity between the primary and foreign keys in your tables to ensure the overall integrity of your data.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
If you are planning on using an ActiveRecord design pattern then I suggest you use surrogate keys on your tables, as it tends to make the mapping more straightforward.
|
|
|
|
|
A Microsoft MVP has posted a Visual Studio add-on that puts project templates into VS for creating a LINQ to SharePoint project. The templates are posted on the CodePlex site at http://www.codeplex.com/LINQtoSharePoint[^]. This enables you to use LINQ against any SharePoint site you have access to.
There's only read access at this point but the next release will support SubmitChanges() as well.
For more information for developers on the Microsoft platform, see the US ISV blog[^].
|
|
|
|
|
Did I miss something? Where is the question in this post?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
i want help with this issue,i want to make sql expression as a math operation (add two columns and store the result in a new column)...i tried it as i used to do it in vs 2003 but it didn't work,it gave me an exception,i'd like to know how to make sql expression in ado.net using vs 2005 ,and do i have to make changes in the database or what?!!!
|
|
|
|
|
To add a new column to a table, run a DDL query like the following:
ALTER TABLE mytable
ADD mycolumn datatype [NULL|NOT NULL]
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
this isn't what i mean...i mean i want to get a calculated column from other two column the application is ado.net and im using vs 2005 it gives me exception that myCalculatedColumn is a calculated one that's it!!! that's what the exceptiona says only...when i write the expression in vs.net like this :
myDataset.table["MyTable"].columns["MyCalculatedColumn"].Expression = "Acolumn - Bcolumn";
this throw exception which i don't know why!!! anyone knows what should i do!!
|
|
|
|
|
here is the exception btw : System.InvalidOperationException was unhandled
Message="The column mapping from SourceColumn 'Overall' failed because the DataColumn 'Overall' is a computed column."
Source="System.Data"
StackTrace:
at System.Data.Common.DbDataAdapter.UpdatingRowStatusErrors(RowUpdatingEventArgs rowUpdatedEvent, DataRow dataRow)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
at testingthefuckingexepression.GymDataSetTableAdapters.NewaccountingTableAdapter.Update(NewaccountingDataTable dataTable) in C:\Documents and Settings\Mr.mohamed\My Documents\Visual Studio 2005\Projects\testingthefuckingexepression\testingthefuckingexepression\GymDataSet.Designer.cs:line 2236
at testingthefuckingexepression.Form1.newaccountingBindingNavigatorSaveItem_Click(Object sender, EventArgs e) in C:\Documents and Settings\Mr.mohamed\My Documents\Visual Studio 2005\Projects\testingthefuckingexepression\testingthefuckingexepression\Form1.cs:line 30
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at testingthefuckingexepression.Program.Main() in C:\Documents and Settings\Mr.mohamed\My Documents\Visual Studio 2005\Projects\testingthefuckingexepression\testingthefuckingexepression\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|
|
|
|
|
Hi All
I am new to Sql Server , I want to Create a row level trigger on table
My Reqiurement is as below :
i create one data transfer utility which Transfer data of sourece table to destination table of mapped column (Mapping is done manually i.e. name of source & destination columns may be same or different )
I want to write trigger on source table for insert , it take new inerted value of mapped column of source and insert it into mapped column of destination table
Can any one help me
Thanks for Your Time
Anil jagdale
|
|
|
|
|
hi
you can write the trigger on Source table for insert..
and you will get the inserted value from table "insertiing"
eg; select emp_staffid from inserting
will return the emp_staffid ie: inserted
and you can insert that value in to detination table
regards
Joe
-- modified at 6:24 Friday 2nd November, 2007
|
|
|
|
|
hi All
In my Company we are using SQL 2000, and we want to upgrade to SQL2005. we have an inhouse GIS web Application that uses ARc GIS servers. Am not experienced in GIS. i just Gooogled what was Arc GIS server. Now ArcGIS server needs to be upgraded to version 9.2. So my question is, can we still keep the version of SQL 2000, while the upgrade of 2005 is taking place on the same server. because we want to keep some other applications under SQL 2000 And still upgrade to ArcGIS 9.2.
i hope i explained it, i tried
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Create a backup of your database. Restore it under a different name and run the upgrade wizard against this new database.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi Paul
Thanks for the reply. So if i have Written my stored procedures in SQl2000, will they get Affected in 2005?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Shouldn't be any problem. SQL 2005 is backwards-compatible, so all your stored procedure code should work OK.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks
i Appreciate your help, last Question
If i have 2 servers one Running SQl2005 And the Other Running SQL 2000, will it be Possible to Access the a certain database in SQL2005 server from SQl 2000 server?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I'm not sure what you mean? How do you want to access it?
The best way to find out would be to try it for yourself. I don't have access to an instance of SQL 2000 at the moment.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Is it possible to iterate through a table or a temporary, because i have to add a temporary column and insert different values for each row according to condition to return a comma separated value. I show a rough sketch what i want to do.
Select SAP.LoginName,var="--Some Very Long Query according to a criteria within the rows of a table like where Test.Folder_ID=CM.Folder_ID--"
From dbo.sysCommunicatorMessages CM
Inner Join dbo.sysAppLogins SAP On CM.MESSAGEFROM = SAP.LOGIN_ID
where "--Some Criteria--" and CM.Folder_ID<>-2
I have used functions to solve the problem but they are currently not acceptable.
Bye
|
|
|
|