|
When i run a crystal report file from vb one error like
' SERVER YET NOT OPEN'
comes how to solve it?
|
|
|
|
|
This means the crystal report is unable to connect with the database to genrate the report. The problem could be the file path, database password, etc.
Yogesh Agarwal
|
|
|
|
|
Hi guys, I am beginner in ASP.NET Programming. I want to know one thing, what is think really simple. I have a textbox and a button, and I would like the text what will be entered in the textbox to be added in the table in the database. If is possible, in C# language, cause I am using that language. Thanks ahead
|
|
|
|
|
laziale wrote: I am beginner
Now that you've said that, I recommend you to do some research using google.
Give a man a fish, he'll eat for a day. Teach a man how to fish, he'll eat for lifetime.
Pradeep Joe
|
|
|
|
|
I did it, but the results there are not really helping to me.
|
|
|
|
|
use the following : -
<br />
<br />
1. Import the SqlClient namespace<br />
<br />
2. Create the object of SQL Connect to bind with SQLServer<br />
<br />
SQLConnection con=new SQLConnection("Initial Catelog=test;Data Source=.;user id=sa;password=pwd");<br />
<br />
here <br />
<br />
Data Source is the computer name on which the database in created<br />
Initial Catelog is the database name available on the server<br />
user id is the user id for database as on password<br />
<br />
<br />
3. Now create the command object to give the sql command to the sever<br />
<br />
SQLCommand cmd=new SQLCommand(sqlstr,con);<br />
<br />
here con is the object for connection and sqlstr is the query to execute like in our case it is<br />
<br />
"insert into tbltest values ('" + txtname.text + "')"<br />
<br />
4. Now Execute the command using cmd object<br />
<br />
cmd.ExecuteNonQuery();<br />
<br />
<br />
Remember to open the connection using <br />
con.Open()<br />
before xecution of Query.<br />
<br />
<br />
If fell any trouble then plz reply
With Regards
Yogesh Agarwal
|
|
|
|
|
and what should I write for the button onclick action??
Btw thx for the previous reply, I appreciated, and it really help me.
and I get one error for connection con.open:
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)
|
|
|
|
|
The code i gave could be written on button click event and if you receive this message then check you connection string is it correct??
Yogesh Agarwal
|
|
|
|
|
Thx man, it works now for me, I learn something new today. Have a nice time till the next chat and best wishes
|
|
|
|
|
Since comma is a delimiter in sql queries, are there any way that let me insert a float that has a comma as decimalsign
for example the table is:
testtable
col1 varchar(20);
col2 float;
insert into testtable ("blah", 2,2)
this of course wouldnt work since 2,2 acts as two values not as one
the european computers have comma set in the regional settings. so this could be problematic unless i change the decimal to a dot.
|
|
|
|
|
Deques wrote: the european computers have comma set in the regional settings. so this could be problematic unless i change the decimal to a dot.
The only way this is going to be a problem is if you are injecting values in to the SQL string. If you use parameters this is not an issue and nor does it blow a massive security hole in your application.
Please read this article on SQL Injection Attacks and how to prevent them[^]
|
|
|
|
|
hello,
i'm doing project 'check status bus express via SMS'. the connection is between handphone and GSM modem.right now,i didnt know how to search the database in MS Access using gsm modem(FARGO MAESTRO 100).
If i in wrong forum,can someone point out which forum should i entered..
with regard,
ieyra
|
|
|
|
|
Hello I have problem deleting rows
Below is the function I call when the user explicitely ask updade for it's changes
The dataset is the datasource of a datagridview
The first time the function is called it works fine
But if it is called a second time with the same datagrid view I got the error
{"Concurrency violation: the DeleteCommand affected 0 of the expected 1 records."}
But if I make another select between the two call : no error
I probabely miss something ?
private void do_update()<br />
{<br />
<br />
MySqlCommandBuilder cb = new MySqlCommandBuilder(adaAddr);<br />
<br />
DataSet ch = new DataSet();<br />
ch = dsAddr.GetChanges(DataRowState.Deleted);<br />
if (null != ch)<br />
{<br />
int del=adaAddr.Update(ch);
lbl_delcnt.Text = del.ToString();<br />
}<br />
<br />
ch = dsAddr.GetChanges(DataRowState.Modified);<br />
if (ch != null)<br />
{<br />
int upd=adaAddr.Update(ch);<br />
lbl_updcnt.Text = upd.ToString();<br />
}<br />
<br />
ch = dsAddr.GetChanges(DataRowState.Added);<br />
if (ch != null)<br />
{<br />
int add=adaAddr.Update(ch);<br />
lbl_addcnt.Text = add.ToString();<br />
}<br />
<br />
MySqlCommand cmd = new MySqlCommand("DELETE from tours where addrID not in ( select addrID from address );", conn);<br />
int tourdel=cmd.ExecuteNonQuery();<br />
lbl_deltourcnt.Text = tourdel.ToString();<br />
<br />
return;
|
|
|
|
|
Hi Guys,
Accedientally i delted a record in table when i was trying to do it on a temporary table.How do i recover the data in the table.Could you please let me know to ROll Back my data in table.
Your help is much appreciated.
Thank you
Kibrom
|
|
|
|
|
Did you take regular backups of your database? If so, restore from the last backup.
If not, then you've lost it forever. Maybe this will teach you the importance of taking regular backups.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello there guys.
Im experiencing a problem with an update statement and this is the error I get when trying to log into my website.
Error Occured:
Error # -2147467259 Operation must use an updateable query.
SQL = UPDATE tbl_employees SET lastlogin = #28-Feb-2008# WHERE employeelogin = 'SIPHOSIBUYANE'
I tried to check the permission(They are correct), files(They are in the right places).Now I dont knw what could be the problem.
Here is the update statement.
Private function RunSQL(ByVal sql,ByRef myRS)
'Response.Write sql & " "
On Error Resume Next
if lcase(left(trim(sql),6)) = "select" then
set myRS = server.CreateObject("adodb.recordset")
myRS.open sql,conn,3,3
else
select case lcase(left(trim(sql),6))
case "update", "delete"
if instr(lcase(sql),"where") = 0 then
response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!"
boolDoNotRunQuery = true
response.end
end if
end select
if boolDoNotRunQuery <> true then
set myRS = conn.Execute(sql)
end if
end if
if err.number <> 0 then
Response.Clear
Response.Write "Error Occured:
"
Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & " "
Response.Write "SQL = " & sql & " "
Response.End
End if
On Error Goto 0
end Function
Private function DoSQL(ByVal sql)
'Response.write sql & " "
On Error Resume Next
boolDoNotRunQuery = FALSE
actionWord = left(trim(sql),6)
select case lcase(actionWord)
case "update", "delete"
if instr(lcase(sql),"where") = 0 then
response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!"
boolDoNotRunQuery = true
response.end
end if
end select
kagiso
|
|
|
|
|
This site is working fine from the server and on the computer(Local host), so I only copied the files across to the ftp folder of the web hosting company and the problem begun.
What should I do??
Thanx in advance.
kagiso
|
|
|
|
|
REMOTE is a Linked Server on HEADOFFICE
When I execute this T-SQL script on HEADOFFICE to test the connection :-
SET XACT_ABORT ON<br />
begin distributed tran<br />
select * from REMOTE.master.sys.sysprocesses<br />
commit tran<br />
SET XACT_ABORT OFF
I get the following error message :-
Msg 8501, Level 16, State 2, Line 1<br />
MSDTC on server 'REMOTE' is unavailable.
Both servers have DTC running and I checked that the firewalls have ports 1433 and 1434 open.
Any ideas would be appreicated.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi,
can any one tell me what is the Difference between SQLSERVER 2000 and SQLSERVER 2005
With Regards,
Anu
|
|
|
|
|
|
|
there is a big difference of 5...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
i want to delete the record from datagrid using sqlcommandbuilder.getdelete command,
after selecting a pericular record from datagrid the record should be deleted.how it is possible.
weather i have to provide some parameter if yes then what is the syntax to provide .please help me.
|
|
|
|
|
I would like to know how I can set a new value into the triggers inserted recordset. Example: All dates on or before 1/1/1900 are to be set to null. Then a date in the fourth column comes in as 1/1/1900 in the inserted column. I can find out that the value needs to be set, but how can I change it to null before it is actually set in the database?
Thanks,
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
You could use an INSTEAD OF UPDATE trigger that fires when an UPDATE statement is executed against your table. The inserted table would contain details of the changes which were going to be made. You can then examine these values and execute a different UPDATE statement which either updates the fields as they were originally going to be updated, or sets fields to NULL where the value <= 1/1/1900.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|