|
The problem is that you're asking Sql server where Sql server is located. The name "ADMIN-PC" points to an IP-adress. Your data source would be "ADMIN-PC\SQL2005", or something similar.
It may very well be that you require the IP-adress to connect from the PDA to the server. That requires you to know at least the connection-details of your server, and it will require a network-connection.
I are Troll
|
|
|
|
|
Hi Eddy,
If the name of my server in sql server is:ADMIN-PC (SQL Server 9.0.1399 - sa),what sould be the datasource field???is it like that:
string sConnection = "Data Source= ADMIN-PC\\SQL Server 9.0.1399 - sa,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";
Thanks for u clarification
|
|
|
|
|
Something along these lines;
string sConnection = "Data Source= ADMIN-PC\\SQL2005;Initial Catalog=GMAO;User ID=sa;Password=sa;";
or, for the default instance;
string sConnection = "Data Source= ADMIN-PC;Initial Catalog=GMAO;User ID=sa;Password=sa;";
..and no, it's not going to be that simple. Take a deep breath and make some coffee
--edit;
Location and instance-name of Sql Server are determined when you install it[^].
Your PDA-application needs to "know" where this server is, and it needs to be in the same network as that computer. At this moment I'm still wondering whether you have network-connectivity between those two.
I are Troll
modified on Friday, May 7, 2010 11:34 AM
|
|
|
|
|
Hi Eddy,
I have not a real PDA to check.I wanna use only the emulator on my application.
Also I changed my code someway:
string adr="SELECT @@SERVERNAME AS 'Server Name';";
string sConnection = "Data Source=" + adr + ",1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";
but not knowing my SQL SERVER
If I installed saye my sql server and don't get the info about the instance,noway to know it after????
I am really boulversing
Thanks
|
|
|
|
|
Tunisien86 wrote: If I installed saye my sql server and don't get the info about the instance,noway to know it after????
Well, you can, using the very same SQL statement that you're posting.
- Open Sql Management Studio Express, and connect to the server
- Start a new query
- Execute the statement
SELECT @@SERVERNAME
That would result in a string in the format "Computername/Instancename".
I'd recommend creating a small application to do a simple select against that server; It's easier to build and limits the scope of the problem to "connect to Sql Server from a PDA".
I are Troll
|
|
|
|
|
|
Tunisien86 wrote: I found the solution ther in this post:
My string connection is like that now:
That's looking better
Tunisien86 wrote: But Eddy still some problems in my TCP/IP connection
There's some bumps on the road, but we can tackle them one atta time. I'd suggest starting with a "New Project", and to create a small prototype application that connects to the server and displays the results of the query, or the Exception if one is generated.
Your connectionstring should be enough to allow you to create a SqlConnection .
I are Troll
|
|
|
|
|
Hi Eddy,
As u told me,I open a new thread:SQL server name not found:Admin-PC\MSSQLSERVER,1433
but still not working yet
Thanks Eddy
(after this long collaboration between as i suggest if u like we meet in msn or skype as freinds ok
my skype is :elgafsiensi and my msn is:marwenG@hotmail.fr)
|
|
|
|
|
Tunisien86 wrote: As u told me,I open a new thread:SQL server name not found:Admin-PC\MSSQLSERVER,1433
Not a new thread, but a new project
A small application to "prove" that it works and to test whether all settings are correct.
Tunisien86 wrote: but still not working yet
You know the drill; we'd need code and an exception-message to diagnose something.
Tunisien86 wrote: Thanks Eddy(after this long collaboration between as i suggest if u like we meet in msn or skype as freinds ok
You're welcome. I'll add you to the list, I'm online once or twice every month
I are Troll
|
|
|
|
|
hi
i want to make a GIS application in .net 4.0
can any one provide me the Link of how to create spatial database in SQL 2005
and connecting it with c#
|
|
|
|
|
Spatial is new to SQL SERVER 2008. here is a tutorial[^]
|
|
|
|
|
|
thank u so much
jazak ALLAH
|
|
|
|
|
When we search with for "mobile" word, using "like" as follows:
select ID from Table where column like '%mobile%'
we can get: mobile, bile.
But we can not get mobility or mobilization in result, even though they are related words for mobile word we are searching for.
So, Do you have solutions to handle those related words, I mean when search for mobile, we can get in result the words mobility and mobilization?
modified on Thursday, May 6, 2010 3:07 PM
|
|
|
|
|
Abdul-Rhman Alsri wrote: related words for mobile word
Someone needs to define that relationship.
One way is to include that in your query
select ID from Table where column like '% mobile %'
or column like '% mobilization %'
or column like '% mobility %'
;
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
I need it in general, because the word I search for is not determined explicity, but it's also retrieved from database.
SELECT a.id AS [CampaignID],
b.id AS [ZoneID],
a.adheadline,
a.adtext,
a.displayurl,
a.targeturl
FROM adcampaign a
INNER JOIN adzone b
ON a.sitecategory = b.category
AND a.LANGUAGE = b.LANGUAGE
AND a.keyword LIKE '%' + b.keyword + '%';
|
|
|
|
|
Perhaps another table that links similar words is needed.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
What database product are you using? If you are using MS SQL you can use things like SOUNDEX and FREETEXT.
|
|
|
|
|
SELECT id FROM AdCampaign WHERE FREETEXT(Keyword, 'going');
Error:
Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'AdCampaign' because it is not full-text indexed.
|
|
|
|
|
One of the things I did in VS2008, was to call GetChanges on the dataset during the FormClosing event to determine if changes have been made but not saved. Doing this in VS2010 always returns a non-null value even if the dataset has not been changed. This is causing the user to be prompted if they want to save their changes even though they just selected the SAVE icon from the application which saves any changes. I even tried calling AcceptChanges but I still get a non-null value coming back from GetChanges.
Is this a bug, or did something change in VS2010. Is there another way to check this?
Thank you,
Glenn
|
|
|
|
|
When I click button Update this error is cccurred :
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'nvarchar'.
my SqlDataSource is:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:AdNetConnectionString %>"
SelectCommand="SELECT AdCampaign.CampaignName, AdCampaign.AdType AS [Campaign Type], AdCampaign.Date AS [Start Date], AdCampaign.Clicks, AdCampaign.Impr, AdCampaign.DailyBudget AS [Daily budget] , AdCampaign.Status FROM Account INNER JOIN AdCampaign ON Account.ID = AdCampaign.AccountID WHERE (Account.EmailAddress = @EmailAddress)"
UpdateCommand="UPDATE AdCampaign SET DailyBudget = 30 FROM Account INNER JOIN AdCampaign ON Account.ID = AdCampaign.AccountID WHERE (Account.EmailAddress = @EmailAddress)">
<SelectParameters>
<asp:SessionParameter Name="EmailAddress" SessionField="EmailAddress" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="EmailAddress" />
</UpdateParameters>
</asp:SqlDataSource>
the parameter :
<asp:Parameter Name="EmailAddress" />
is a session parameter.
I am waiting please guide me.
|
|
|
|
|
When you click the Update button, some other command was executed. Since I don't see a statement containing "nvarchar" in the code you have posted, I believe you have hooked up the event handler to somewhere else. You can track down the problem using your debugging environment and pinpoint the problematic statement.
|
|
|
|
|
I don't use Wizards to do my database work. But this parameter isn't supposed to have a data type ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
How to form this logic in a true sql?
Select * from AdCampaign where category and language and keyword in
(select sitecategory, language, keyword from Adzone)
|
|
|
|
|
You can use a join. Use something like this:
select a.* from AdCampaign a inner join Adzone b
on a.category=b.sitecategory and a.language=b.language and a.keyword=b.keyword;
|
|
|
|